Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Have a datacard only appear when a filter has been applied to the data

Hi me again,

 

Phase 2. I have two data cards showing a ratio. One datacard remains unfiltered at all times, so when you slice the data, one card changes, and the other shows the overall value for comparison. 

 

Before you slice the data, you've got two data cards showing the same number. Lame. I want to hide the unfiltered datacard UNTIL someone applies filters to my report. 

 

Go.

1 ACCEPTED SOLUTION

@Anonymous That would be more like:

Overall Ratio = 
  VAR __Calc = CALCULATE([Passed Closing SLA]/[Total Closed Encounters],ALL('Closed'))
RETURN
  IF(
    ISFILTERED('Table'[Column1]) || 
    ISFILTERED('Table'[Column2]) || 
    ISFILTERED('Table'[Column3]) || 
    ISFILTERED('Table'[Column4]) || 
    ISFILTERED('Table'[Column5]) || 
    ISFILTERED('Table'[Column6]),
    __Calc,
    BLANK()
  )

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

12 REPLIES 12
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

You will need to use bookmarks.

 

See if these help

 

https://medium.com/@arjunuttamsharma561/hiding-a-visual-from-report-dashboard-in-power-bi-9bc5bfc57b69

 

https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/#:~:text=Format%20the%20Card&text=Click%20on%20Conditional%20formatting%2C%20Select,The%20visual%20to%20show%2Fhide.

 

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

S

 

Anonymous
Not applicable

@harshnathani  I'm pretty sure I can do it without using bookmarks, I think it's possible with a measure and using transparency but i'm not sure how. 

Hi @Anonymous ,

 

See the second link..

 

https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/#:~:text=Format%20the%20Card&text=Click%20on%20Conditional%20formatting%2C%20Select,The%20visual%20to%20show%2Fhide

 

 

This is without a Bookmark.

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Greg_Deckler
Super User
Super User

@Anonymous - Can you use ISFILTERED to check and return BLANK?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Probably @Greg_Deckler but i'm not sure how to adapt the measure to hide the data card it's in until the data is filtered. 

This is the measure, which you helped me with yesterday:

 

Overall Ratio = CALCULATE([Passed Closing SLA]/[Total Closed Encounters],ALL('Closed'))
 
I tried putting the ISFILTERED before and after the CALCULATE and it gets upset. 

@Anonymous - Maybe:

Overall Ratio = 
  VAR __Calc = CALCULATE([Passed Closing SLA]/[Total Closed Encounters],ALL('Closed'))
RETURN
  IF(ISFILTERED('Table'[Column]),__Calc,BLANK())

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler ok, but the 'Table'[Column] - I don't want to specify a column, as it will only work then if that column is used as a slicer. And I have 6 slicers, and I want the measure to remain blank until any of the slicers are applied. Is this possible?

@Anonymous That would be more like:

Overall Ratio = 
  VAR __Calc = CALCULATE([Passed Closing SLA]/[Total Closed Encounters],ALL('Closed'))
RETURN
  IF(
    ISFILTERED('Table'[Column1]) || 
    ISFILTERED('Table'[Column2]) || 
    ISFILTERED('Table'[Column3]) || 
    ISFILTERED('Table'[Column4]) || 
    ISFILTERED('Table'[Column5]) || 
    ISFILTERED('Table'[Column6]),
    __Calc,
    BLANK()
  )

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks guys, @Greg_Deckler came up with a solution that works perfectly for my report. Thanks so much I really appreciate it. 

I would genuinely be lost without you!

@Anonymous
I think you're looking for something like this;
https://www.linkedin.com/pulse/show-different-visuals-based-condition-power-bi-alina-fisher/

Your DAX would be using the 'Closed' table I guess?

Font Color Switch =
= IF(ISFILTERED('Closed')
,"#FFFFFF00"
, "white")

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

@AllisonKennedy ok I can create the measure, but I don't know where to put it, I tried under the field value of the conditional background of the data card but it doesn't make a difference. 

@Anonymous

You may need to update the measure to use "black" instead of "white" and you may need to swap the order of the transparent hex code and color.

Background is white anyway by default so you won't see much difference applying it to background. You'll need to apply it to the 'data label' property color at a minimum, and maybe 'category' and 'border' properties too depending on what you data card looks like.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.