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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
Mann
Resolver III
Resolver III

Visual Interaction on Power BI visual to behave like slicers or filters

Hi Guys,

I have a strange requirement.

I have created a bar chart showing some metric in percentage(calculation logic is not important here) by countries.
I have a filter on countries in filter pane.

I am hiding this chart when distinctount of salesperson per country is less than 100. I am using this measure

Countcheck:
IF( Calculate( Distinct count(TableA[SalespersonID]),Allselected(TableA[Country])) <100,1,0)

I use this measure in visual level filter and always keep it equal to "0".

For e.g. When user selects one or more countries from the filter then measure calculation happens to check what is distinct count of salesperson for the selection. If Countcheck is less than 100 then chart becomes blank and custom message is shown. I use card for this message which is present behind the chart.

There is no issue with this calculation. It works as expected when filters are applied from country filter in filter pane.

Now when I am selecting any bar/bars from chart by clicking on chart this measure is executed for the selected country. If the result is <100 then custom message is shown in card but chart is also shown.

I want this measure to make the chart blank but its not happening.

I am not sure if this is possible in Power BI? We want visual interaction to behave the same way like filters.

Let me know if this is achievable in Power BI.

Thanks
1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Mann ,

 

As tested, It's impossible to achieve the idea(2.76.5678.782 64-bit (December 2019)).

Maybe you can consider using a slicer for filtering.

mm2.PNGmm3.PNG

Or  Submit your ideas .

 

Best regards,
Lionel Chen

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

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Mann ,

 

As tested, It's impossible to achieve the idea(2.76.5678.782 64-bit (December 2019)).

Maybe you can consider using a slicer for filtering.

mm2.PNGmm3.PNG

Or  Submit your ideas .

 

Best regards,
Lionel Chen

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

Thanks for the confirmation.
amitchandak
Super User
Super User

Please try. In two options you should hide when sumx =0 it means no country has >100 sales person

sumx(TableA,IF( Calculate( Distinctcount(TableA[SalespersonID]),values(TableA[Country])) <100,1,0))


sumx(filter(summarize(TableA,TableA[Country],"_dist",Distinctcount(TableA[SalespersonID])),if([_dist]>100,1,0)))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for checking on this

I am also using Allselected in my calculation. The reason behind it was that I want to keep outside visual filters active but not the ones within. For example: If I select one country and based on this selection if distinct count comes more than 100 then i want to see all countries in chart view. If it comes less than 100 based on selection than I hide the chart and custom message will be shown from card.

This currently works fine when filters applied from filter pane but not when any bar is selected in bar chart.

I want same to happen when any bar is selected by user.

The calculation you provided doesnt considered this. Can we change the calculation you shared based on above??

Thanks again for your help!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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