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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
tamnguyenEPM
New Member

Measure in Slicer

Hello everyone,

Hope you're all well. 

 

I have a measure as below: 

ID-Print = CALCULATE(count(RisksRegister[Index]),FILTER(ALLSELECTED(RisksRegister),RisksRegister[Index]<= MAX(RisksRegister[Index])))
 
I did a few search on the forum and can't find any applicable solution to my situation. 
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 !
1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @tamnguyenEPM ,

 

You can create a new table for slicer:

 

Capture1.PNG

 

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)

 

Capture2.PNG

 

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

 

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @tamnguyenEPM ,

 

You can create a new table for slicer:

 

Capture1.PNG

 

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)

 

Capture2.PNG

 

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

 

Ashish_Mathur
Super User
Super User

Hi,

See my reply to a similar post here - Solved: Re: Grouping data together - Microsoft Power BI Community


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
edhans
Super User
Super User

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.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.