Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Show multiple measure based on single slicer selection

Hi All,   My requirement is as follows. I have created 6 measures that belong to 3 different categories(2 meaures for each category). For example, my categories are   OOG(measures are OOG CY, OOG...
  • v-gizhi-msft's avatar
    6 years ago

    Hi,

     

    According to your description, I create a table to test:

    Please take following steps:

    1)Create six measures like you:

    OOG CY = SUM(Sales[Sales])

    OOG PY = SUM(Sales[Sales])*10

    IIF CY = SUM(Sales[Sales])*20

    IIF PY = SUM(Sales[Sales])*30

    ZF CY  = SUM(Sales[Sales])*40

    ZF PY  = SUM(Sales[Sales])*50

    2)Create a table by ‘Enter Data’:

    3)Create a measure to display what you want:

    Measure

    = SWITCH(SELECTEDVALUE(SlicerTable[SlicerValue]),"OOG CY",[OOG CY],"OOG PY",[OOG PY],"IIF CY",[IIF CY],"IIF PY",[IIF PY],"ZF CY",[ZF CY],"ZF PY",[ZF PY])

    4)Choose [BelongTo] as a slicer and the result shows:

    Here is my test pbix file:

    pbix 

     

    Best Regards,

    Giotto Zhi

  • Anonymous's avatar
    Anonymous
    6 years ago

    Bravo ! My issue is fixed. Thanks much !

  • v-gizhi-msft's avatar
    v-gizhi-msft
    6 years ago

    Hi,

     

    Please add a new column [Index] in Query Editor:

    Then, change this table sort by [Index] in Modeling pane:

    And the visual shows the PY first and CY second:

     

    Best Regards,

    Giotto Zhi

  • Anonymous's avatar
    Anonymous
    6 years ago

    It did work. Thanks !