Forum Discussion
Measure in Slicer
Hello everyone,
Hope you're all well.
I have a measure as below:
I'm trying to add a slicer with the ability to group the ID-Print into range one: 1-6, 7-12, 13-18.
So I can select the proper range - display them in the report and print them.
Unfortunately the slicer won't accept the measure as value.
Can you please help ?
Thank you !
Hi tamnguyenEPM ,
You can create a new table for slicer:
Then you can create the following visual level filter and add it to the visual you want to filter by slicer:
measure = IF(ISFILTERED('Table'[Value]),IF([ID-Print]>= MAX('Table'[left]) &&[ID-Print] <=MAX('Table'[right]),1,0),1)If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
3 Replies
- edhans
Community Champion
You must create either a calculated column in DAX or a custom column in Power Query. Measures always only have 1 value so even if you could add it to a slicer it would be one value. They only seem to have multiple values because they recalculate different ways depending on the filter context, say rows in a table visual, or per the axis of a bar chart.
And you cannot use ALLSELECTED in a calculated column. Calculated columns only calculate at refresh before any selections are evaluated so it will not return expected results, and user selection will do nothing.
Perhaps you can share some data and give us some screenshots of expected results.
- Ashish_Mathur
Super User
Hi,
See my reply to a similar post here - Solved: Re: Grouping data together - Microsoft Power BI Community
- v-deddai1-msft
Community Support
Hi tamnguyenEPM ,
You can create a new table for slicer:
Then you can create the following visual level filter and add it to the visual you want to filter by slicer:
measure = IF(ISFILTERED('Table'[Value]),IF([ID-Print]>= MAX('Table'[left]) &&[ID-Print] <=MAX('Table'[right]),1,0),1)If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai