Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a challenge filtering a measure. I know I can't use a slicer, and I need the filtering to happen in the whole dashboard. Therefore, I need a DAX to filter out all the values that are not above zero. Example below:
I have a table called HotelsInGermany. In this table, there is a measure called [# of hotels]. In this measure, there are in some cases zero hotels in some of the cities. I intend to make another DAX on the [# of hotels], where I filter for all values above zero and then use this measure instead of the original one.
Question: How do I filter out all the zeros in the measure [# of hotels] so I only can see the cities with at least one hotel via a DAX measure?
I hope you guys can help me 🙂
Hi,
The most straight-forward way is to use slicer pane:
Additionally you can create dynamic filtering using many different methods. E.g. using a filter measure and an iput table:
Dax:
By selecting different values in the new slicer the filter logic of the table changes.
Proud to be a Super User!
hi @ValtteriN ,
I need to use this measure in various visuals, which means the filtering has to be in a DAX. I think making a dynamic filter in the way you are thinking would make me have to add all the visuals to the filter. My idea was to sort out all the zeros in a new DAX and use this DAX instead of the other one.
But thank you for sharing your idea. Let me know if you have any new ideas :-).
Hi,
If you want a to apply filter logic to all your visuals you can create a calculation group referencing the filter measure:
You can also use the filtering logic within a calculation group to apply it to multiple measures.
calculate(selectedmeasure(),FILTER('Table (18)',[Measure 35]>0))
Proud to be a Super User!
hi @FreemanZ,
I need to use this measure in various visuals, which means the filtering has to be in a DAX. I think adding it to the filter pane would make me filter each visual every time I use the measure [# of hotels].
But thank you for sharing your idea. Let me know if you have any new ideas :-).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
75 | |
52 | |
46 | |
15 | |
12 |