Hide/unhide a card depending on a condition
-
Hide/unhide a card depending on a condition
Posted by Unknown Member on January 19, 2018 at 9:35 am-
Hi, has anyone tried hiding a visualization card if the value is zero, and unhide it if it the value is 1 or more?Ā Would this need programming or just special formulas?
Thanks,?
——————————
Noel Ortiz
BI User
BuildingLink.com, LLC
New York NY
2014671394
—————————— -
Danny Dennison
MemberJanuary 22, 2018 at 10:41 AM
If it helps, I just attended a “Bookmarks/Drillthrough” webinar and asked a similar question… this was Ted Pattison’s (of criticalpathtraining.com) response:Q: I am curious if “spotlighting” can be conditional (e.g. it occurs when a threshold is met)
A: Unfortunately, no. Bookmarks only allow you to restore recorded settings. They do not provide any basis for logical behavior (e.g. IF this THEN that).
——————————
Danny Dennison
Business Intelligence Analyst
Reynolds Lake Oconee
Greensboro GA
7064671624
——————————
——————————————- -
?Thanks, Danny.Ā Looking forward to having visualization logic (IF/THEN), if (or when) that time comes.
——————————
Noel Ortiz
Controller
BuildingLink.com, LLC
New York NY
2014671394
——————————
——————————————- -
Danny Dennison
MemberJanuary 22, 2018 at 11:52 AM
Was going to submit an “idea”, but someone beat me to it:Make the spotlight feature conditional
Microsoft Power BI remove preview Make the spotlight feature conditional Make the ability to spotlight a visual conditional so that if the condition is met – it can then automatically spotlight the visual View this on Microsoft Power BI > Let’s get the word out and vote!
——————————
Danny Dennison
Business Intelligence Analyst
Reynolds Lake Oconee
Greensboro GA
7064671624
——————————
——————————————- -
Simon Hill
MemberJanuary 22, 2018 at 11:06 AM
?It’s not reallyĀ a solution, but could you create multiple versions of a dashboard and point the user to a specific version depending on the variable? I suppose it really would depend on whether that variable can be accommodated in a URL string…——————————
Simon Hill
Manager
TTX Company
Solihull
——————————
——————————————- -
Tom Blodget
MemberJanuary 23, 2018 at 10:08 AM
You could go back to (HTML and CSS) basics. I’m learning this from the aforementioned Critical Path Training webinar “Designing Power BI Reports using Bookmarks and Drillthrough” (now on theirĀ YouTubeĀ channel).The htmlViewer custom visual is very versatile but a bit of work. It would take awhile to reproduce even the simple functionality of a Card tile. But for some situations, it would be simple.
Example
Create a table named Data:
#table(type table [#”key”=text, #”value”=number], {{“zero”, 0},{“one”, 1}})Added a computed column, which is a template for each row:HTML = “<div style=’display: ” & If(Data[value] = 0, “none”, “block”) & “;’>” & Data[key] & “: ” & Data[value] & “</div>”Place a slicer for Data[key].Place an htmlViewerĀ for Data[HTML]
Slice for “one”, its div shows. Slice for “zero”, its div takes no space and shows nothing. Similarly, for slicing for both “one” and “zero”.
(Obviously, this lacks HTML escaping. You could write a Power Query function for that.)
——————————————-
-
?Hi Noel,
One alternative you could try is as follows.
1. Assume you want to display a measure1 in a card. Measure1 will contain values from 0 to 99999.
2. Create another measure , say ShowMeasure as
Ā Ā Ā ShowMeasure = IF ( [Measure1] > 0, [Measure1], “”)3. Now use the ShowMeasure as the value to be displayed in the Card visual. Bear in mind to trun off the category label and title off.Ā By turning category label off you will not see the ShowMeasure being displayed.
Let me know if this works for you.
Cheers
Srinivasan
——————————
Srinivasan Krishnan
MD
Samiksha Consultancy Services
Singapore
81138415
——————————
——————————————-
Unknown Member replied 7 years, 8 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘Hide/unhide a card depending on a condition’ is closed to new replies.