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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
amaaiia
Super User
Super User

How to enable a visualization only if at least one slicer value is selected

Hi,

I'm doing some testing with PafNow Procces Mining visualization.

I have a lot of flows to show in the visualizacion, but I want to enable visualizacion only if one or more flows are selected from slicer. That is, by default visualization has to be hidden. I've checked visualization properties but I can't see a visibility option. I was thinking in a measure like this: 

SelectedCount = COUNTROWS(VALUES(Table[SlicerColumn]))
And enabling visualization if this measure >0. But I don't know how to achieve this.
Any ideas?
1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @rohit1991 , for your response.

 

Hi @amaaiia,

 

To ensure that the visualization remains hidden by default and becomes visible only upon selecting a slicer value, without restricting user interaction, kindly follow the steps mentioned below, as they may assist in resolving the issue:

 

1.Create the following measures:

SelectedCount = COUNTROWS(VALUES('Table'[SlicerColumn]))

ShowVisualFlag = IF([SelectedCount] > 0, 1, 0)

Ensure that 'Table'[SlicerColumn] corresponds to the relevant slicer.

2.Add ShowVisualFlag to the PafNow visual’s Filters pane at the visual level.Set it to is 1, ensuring that the visualization remains hidden when no slicer value is selected.

 

3.Overlay a Card on the Visualization.Use the following measure for the card:

DisplayMessage = IF([ShowVisualFlag] = 0, "Select a slicer value to view.", BLANK())

Assign this measure to the card’s Fields pane.

 

4.Configure the Card’s Background Transparency.Define the following measure:

CardTransparency = IF([ShowVisualFlag] = 1, 100, 0). 

Apply this measure using the fx button under Format Visual > Background > Transparency. This ensures that the card disappears when a slicer value is selected.

 

5.When no slicer value is selected, the card displays the message, and the visualization remains hidden.When a slicer value is selected, the card disappears, and the visualization appears while remaining fully interactive.

 

If you find this response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

Thank you.

View solution in original post

8 REPLIES 8
v-pnaroju-msft
Community Support
Community Support

Hi amaaiia,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi amaaiia,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @rohit1991 , for your response.

 

Hi @amaaiia,

 

To ensure that the visualization remains hidden by default and becomes visible only upon selecting a slicer value, without restricting user interaction, kindly follow the steps mentioned below, as they may assist in resolving the issue:

 

1.Create the following measures:

SelectedCount = COUNTROWS(VALUES('Table'[SlicerColumn]))

ShowVisualFlag = IF([SelectedCount] > 0, 1, 0)

Ensure that 'Table'[SlicerColumn] corresponds to the relevant slicer.

2.Add ShowVisualFlag to the PafNow visual’s Filters pane at the visual level.Set it to is 1, ensuring that the visualization remains hidden when no slicer value is selected.

 

3.Overlay a Card on the Visualization.Use the following measure for the card:

DisplayMessage = IF([ShowVisualFlag] = 0, "Select a slicer value to view.", BLANK())

Assign this measure to the card’s Fields pane.

 

4.Configure the Card’s Background Transparency.Define the following measure:

CardTransparency = IF([ShowVisualFlag] = 1, 100, 0). 

Apply this measure using the fx button under Format Visual > Background > Transparency. This ensures that the card disappears when a slicer value is selected.

 

5.When no slicer value is selected, the card displays the message, and the visualization remains hidden.When a slicer value is selected, the card disappears, and the visualization appears while remaining fully interactive.

 

If you find this response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi amaaiia,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

rohit1991
Super User
Super User

Hi @amaaiia ,
To conditionally display a visualization in Power BI only when at least one value is selected from a slicer, you can use a DAX measure to detect slicer activity and then control the appearance of the visual indirectly. Since Power BI does not support native visibility toggling, the common workaround is to overlay a shape or message that appears when no selection is made, or to filter the visual based on a custom measure. 

 

First, create a measure that counts the number of selected values in the slicer. Then, create another measure that returns a flag (1 or 0) based on whether a selection has been made. This flag can be used either as a visual-level filter or for conditional formatting (such as adjusting transparency) to simulate hiding or showing the visual.

-- Measure to count selected values
SelectedCount = COUNTROWS(VALUES(Table[SlicerColumn]))

-- Visibility control measure
ShowVisualFlag = IF([SelectedCount] > 0, 1, 0)

You can then apply ShowVisualFlag as a visual-level filter (set to 1) or use it in a measure that controls a shape's transparency or displays an overlay message prompting the user to select a slicer value.

 

Passionate about leveraging data analytics to drive strategic decision-making and foster business growth.

Connect with me on LinkedIn: Rohit Kumar

Hi,

That's what I've done, the problem is that as the shape is in front of the slicer, the shape gets transparent but I can't click on it to select values, I click de transparent shape. I can't put it in the back because it wouldn't hide the slicer..

v-pnaroju-msft
Community Support
Community Support

Thank you, @ibarrau ,for your response.

 

Hi amaaiia,

 

We would like to check if the solution provided by @ibarrau has resolved your issue. If you have found an alternative approach, we encourage you to share it with the community to assist others facing similar challenges.

If you found the response helpful, please mark it as the accepted solution and add kudos. This recognition benefits other members seeking solutions to similar queries.

 

Thank you.

ibarrau
Super User
Super User

Hi. As user experience a good idea is to show the place of the visual with instruction and when clicking on the slicer changing the login, hide and show. You can follow this tip to make it happen:
https://blog.ladataweb.com.ar/post/685148133462884352/powerbiux-mensajes-respaldando-blancos

The rule of the measure can be done in different ways depending on how you want to handle.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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