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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
lravikiran
Helper I
Helper I

How to display contents of a table only when the slicer is selected .

Hi Experts,

 

           I have a situation where I need to hide the contents of table if my slicer is selected as "ALL" and show the data in table when a slicer is filtered to a perticular selection.

 

So In my example (Refere the Image ) Selected value issue.PNG, I have a table with country and sales. I have a country slicer on page. Only when my selection happens to a perticular country on the slicer should the data be displayed else it must be blank.

 

I tried creating a measure Filter = IF(HASONEFILTER(Orders[Country]),1,0) . 

 

 But it shows 0 only for total but when taking each rows into consideration it gives me issue.

 

PFA link to my pbix and image.

 

PBIX

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

This is the expected behaviour for a measure with HASONEFILTER as the measure expression is effectively evaluated row by row and for every row except the grand total the Country field only has one filter.

 

One way of achieving your desired behaviour would be a measure like the following:

 

Filter = IF(COUNTROWS(ALLSELECTED(Orders[Country]))=1,1)

 

Or you could build this directly into a version of the Sales measure:

 

Filtered Sales = IF(COUNTROWS(ALLSELECTED(Orders[Country]))=1,[Sales])

View solution in original post

2 REPLIES 2
d_gosbell
Super User
Super User

This is the expected behaviour for a measure with HASONEFILTER as the measure expression is effectively evaluated row by row and for every row except the grand total the Country field only has one filter.

 

One way of achieving your desired behaviour would be a measure like the following:

 

Filter = IF(COUNTROWS(ALLSELECTED(Orders[Country]))=1,1)

 

Or you could build this directly into a version of the Sales measure:

 

Filtered Sales = IF(COUNTROWS(ALLSELECTED(Orders[Country]))=1,[Sales])

Thanks a lot . It is working .

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors