Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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 .
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |