Forum Discussion

JustinDoh1's avatar
JustinDoh1
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Create a simple slicer based on measures

I am sharing my Pbix file here.

 

I have been looking for solution online (esp. community.powerbi.com), but could not find a solution.

 

Basically, I would like to create a slicer based on these three measures (Measure1, Measure2 and Others).

 

Expected output are:

1) Have a slicer that has these three values: Measure1, Measure2 and Others.

2) Whenever user clicks the choice in the slicer, it would display only that measure.

 

I tried creating a new table like this:

And got this error, and not sure why.

I was copying the step from this post.

 

What is approach to create a slicer from measures?

 

Thanks.

 

 

 

 

 

 

 

 

 

  • JustinDoh1  The new table won't update with slicer selections, so not sure why you need the Measure values in that table itself? 

    https://excelwithallison.blogspot.com/2020/09/reporting-order-of-operations.html 

     

    Can you simply click Home > Enter Data and create a new 'SlicerTable' with the names of the measures? Just type them in manually.

     

    Then create a new MEASURE: 

     

    UltimateMeasure = 

    SWITCH( SELECTEDVALUE(SlicerTable[Measure], "Measure 1")

    , "Measure 1", [Measure 1]

    , "Measure 2", [Measure 2]

    , "Others", [Others]
    )

     

    Then use the UltimateMeasure in your table visual and add a slicer to the page with the SlicerTable you created using EnterData.

3 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion

    JustinDoh1  The new table won't update with slicer selections, so not sure why you need the Measure values in that table itself? 

    https://excelwithallison.blogspot.com/2020/09/reporting-order-of-operations.html 

     

    Can you simply click Home > Enter Data and create a new 'SlicerTable' with the names of the measures? Just type them in manually.

     

    Then create a new MEASURE: 

     

    UltimateMeasure = 

    SWITCH( SELECTEDVALUE(SlicerTable[Measure], "Measure 1")

    , "Measure 1", [Measure 1]

    , "Measure 2", [Measure 2]

    , "Others", [Others]
    )

     

    Then use the UltimateMeasure in your table visual and add a slicer to the page with the SlicerTable you created using EnterData.

    • JustinDoh1's avatar
      JustinDoh1
      Icon for Post Prodigy rankPost Prodigy

      AllisonKennedy Thank for help.

      I am not clear about the purpose of having "Measure 1" on this line:

      SlicerTable[Measure], "Measure 1")

       

       

       

       

       

       

       

      • AllisonKennedy's avatar
        AllisonKennedy
        Icon for Community Champion rankCommunity Champion

        JustinDoh1  That just provides a default value if they don't select anything, or when they select too many items, so replace "measure 1" with the default measure you'd like to display.