Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 ) , 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.
Solved! Go to Solution.
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])
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 .
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.