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

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.

Reply
cherrypbi
Advocate I
Advocate I

Calculated Measure's values into a slicer/report filter?

I have calculated measures and wanting to use that for a slicer/report filter.

 

I have two calculated measures "Best", "Next Best", 

(Calculated measures solution: Solved: Re: Create new columns from other columns...)

cherrypbi_0-1674175330400.png

 

I'm trying to create 2 filters (slicer) like below. 

ex) If I select Toast in Slicer1_BEST, it will return rows that had "Toast" in the Best column (ex. Mearchant A and other columns)

ex) If  I select Tea in Slicer2_NextBESTit will return Merchant B and other columns) 

 

 cherrypbi_1-1674175351048.png

 

Is this possible? Looks like PowerBI natively doesn't allow measures into slicers and I've tried adding parameter filters but dont think it was working properly. Any guidance is appreciated....!

 

@Nathaniel_C  @Jihwan_Kim  @garythomannCoGC  @amitchandak @bolfri 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

All measures are in the attached pbix file's keymeasures field.

Jihwan_Kim_0-1674190601183.png

 

Jihwan_Kim_1-1674190613217.png

 

 

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

All measures are in the attached pbix file's keymeasures field.

Jihwan_Kim_0-1674190601183.png

 

Jihwan_Kim_1-1674190613217.png

 

 

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


This gave me a good idea to create my own table with the measure values and the IDs and it worked! thanks so much 🙂

awesome, will check this out.thank you!!  Quick question: Your "Data" table has all the values in one table. For my case, all the values come from different tables so I don't really have a central table with Merchant ID + values (revenues). Do you think that makes a difference? 

Hi,

Thank you for your message.

I am not 100% sure how your data model looks like, but if data model looks different, in some cases (I think in most cases), differnt measures have to be written.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


ribisht17
Super User
Super User

https://community.powerbi.com/t5/Desktop/How-to-use-a-measure-as-slicer/td-p/1726564

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

Here is my test table.

ribisht17_0-1674178048903.png

 

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])

return

SUMMARIZE(x1,[Status])
ribisht17_1-1674178048262.png

 

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

ribisht17_2-1674178049187.png

 

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])

return

IF(ISBLANK(x1),1,IF([Status]=x1,1,0))
ribisht17_3-1674178049414.png

 

Result:

 

ribisht17_4-1674178049340.gif

 

Hope that's what you were looking for.

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series

 

This is bit confusing as its a solution from a different scenario

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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