Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Measures into categories

I have 4 measures and what I would like to achieve to have a table and in that table the measures are categorized into four separated row. 

I wrote the following DAX to achieve it: 

Categories =

VAR Measure1 = SUM(Column1)
VAR Measure2 = SUM(Column2)
VAR Measure3 = SUM(Column3)
VAR Measure4 = SUM(Column4)

VAR CALC_FINAL =
SWITCH
(
    TRUE(),
    Measure1, "Measure1",
    Measure2, "Measure2",
    Measure3, "Measure3",
    Measure4, "Measure4",
    BLANK()
)

RETURN CALC_FINAL

But I am recieving the following error message: 

 



The result what I would like to achieve is: 

 


What should I do in order to fix it? 
  • Create 4 separate measures. Add the measures to the values bucket in a matrix visual. Go into the formatting pane and search for "Show on Rows" (I think it's under Values -> Options) and activate it. You will now see each measure as a row with its corresponding value

3 Replies

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

    Create 4 separate measures. Add the measures to the values bucket in a matrix visual. Go into the formatting pane and search for "Show on Rows" (I think it's under Values -> Options) and activate it. You will now see each measure as a row with its corresponding value

    • Anonymous's avatar
      Anonymous
      Not applicable

      It worked! 🙂 

       

       

  • Anonymous . Option 1 Switch Values on rows/ show measure on row

     

    2nd calculation group - Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0 

     

    Also explore field parameters