Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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

 

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) 

 

 

 

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 

  • 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.

     

     

     

     

     

     

6 Replies

  • 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.

     

     

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      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? 

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Icon for Super User rankSuper User

        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.

  • 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.

     

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

     

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

    return

    IF(ISBLANK(x1),1,IF([Status]=x1,1,0))

     

    Result:

     

     

    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

     

    • Anonymous's avatar
      Anonymous
      Not applicable

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