cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

How to use a measure as slicer?

Hi, I have a measure which categorise my data based on few statuses. How can I use this status measure as a slicer?

Status = IF(ISBLANK(Difference),"Gray", IF(Difference>0, "Green", IF(Difference<0, "Red", "Amber")))

- Difference is a measure as well-

I need a slicer with Gray, Green, Red , Amber so users can filter the data base on this. I have to use a measure for the status as a calulated column will not give me the desired results. I cant drag the measure as a slicer.
Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @yybi123 ,

Based on your description, you can so some steps as follows.

Here is my test table.

I create two measures as follows.

`Difference = MAXX('Measure_Slicer_test',[D2]-[D1])`
`Status = IF(ISBLANK([Difference]),"Gray", IF([Difference]>0, "Green", IF([Difference]<0, "Red", "Amber")))`
1. Create a calculated table.
`Status = var x1=SUMMARIZE('Measure_Slicer_test',Measure_Slicer_test[Product],"Status",[Status])returnSUMMARIZE(x1,[Status])`

2. use "Status"[Status] to create a slicer.

3. create a measure, then drag it to the table visual of the original table and set the value as "1".

`Measure_filter = var x1=SELECTEDVALUE('Status'[Status])returnIF(ISBLANK(x1),1,IF([Status]=x1,1,0))`

Result:

Hope that's what you were looking for.

Best Regards,

Yuna

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

13 REPLIES 13
Frequent Visitor

I want to use a total score measure is a slicer , which consist of another measure whose values depends upon the selected value of other columns slicer .The above solution is not working as my measure is a dynamic one based on another measure which is based on slicer selection by user.Is there any workaroudn for this?

Regular Visitor

great job mate, this is very usefull!!

Helper I

Can the same princple be applied to a Matrix? i'm struggling to filter on a Matrix as have added a measure and only want certain records to show.

Frequent Visitor

Add the 'Measure_Filter' to the Matrix as a Field and see how it populates. This helped me visualize this workaround. You should see all 1's. From there you could try to identify why it is not working in the Matrix. Without seeing a model or screenshot, my first thought is it needs adjusting due to a hiearchy?

New Member

Anonymous
Not applicable

Hi,
I want to use measure in the slicer. And that measure consist of another two measures. So, I am not able to acheive this.

Anonymous
Not applicable

Hi @yybi123 ,

Based on your description, you can so some steps as follows.

Here is my test table.

I create two measures as follows.

`Difference = MAXX('Measure_Slicer_test',[D2]-[D1])`
`Status = IF(ISBLANK([Difference]),"Gray", IF([Difference]>0, "Green", IF([Difference]<0, "Red", "Amber")))`
1. Create a calculated table.
`Status = var x1=SUMMARIZE('Measure_Slicer_test',Measure_Slicer_test[Product],"Status",[Status])returnSUMMARIZE(x1,[Status])`

2. use "Status"[Status] to create a slicer.

3. create a measure, then drag it to the table visual of the original table and set the value as "1".

`Measure_filter = var x1=SELECTEDVALUE('Status'[Status])returnIF(ISBLANK(x1),1,IF([Status]=x1,1,0))`

Result:

Hope that's what you were looking for.

Best Regards,

Yuna

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

New Member

Hi @Anonymous ,

From calculated table [Status],
In case the orginial table have several month and business unit, how can we add a column to count how many product under each status, based on date and Business unit filter from Original table.

Frequent Visitor

Great solution representing the inguinity of using the OOB PBI capablities.

Thank you !

New Member

Hi Team,

If One date is fixed and another date is selected on slicer then substarct both dates. and create measure of Date Bucket.

How to create date bucket measure in slicer.

New Member

Thanks! I have a very similar problem. Did exactly the steps you described and it works for the respective page perfectly.

But in my PBI data model i have several pages with different visualizations. And, i do want to make this new slicer (green, red etc.) to be applied for all other pages as well, but it doesn't work at all.

Any solutions for this?

Hope to hear from you.

Best,

The Challenger

New Member

Hi!

I have the same issue.

Did you find a solution?

Super User

@yybi123 , You need to create an independent table with these measure values. and then use them in slicer with group(values)

refer example of binning and segmentation

Announcements

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 Monthly Update - August 2024

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

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors