Forum Discussion

samblackshaw28's avatar
2 years ago
Solved

Dynamic Matrix based on Group of Measures

Hi all,   I have 2 groups of measures which I want to be able to change on a visual with a slicer. The first group is called '1st Meetings' and contains 5 measures to do with 1st meeting numbers: [...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi samblackshaw28 

     

    Power BI does not currently support grouping of measures by your needs, and as Ibendlin mentioned, If you would like to suggest some feature improvements, you can submit it in ideas. It is a place for customers provide feedback about Microsoft Office products.

     

    While it is not possible to create measure groups directly, a similar effect can be achieved by calculating groupings. Please refer to the following steps to see if they help.

    1. Manually create a measure selection table.

    2. Use the following DAX to create a measure.

    SelectedMeasure = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE(MeasureGroup[Measure]) = "Participants" && SELECTEDVALUE(MeasureGroup[Group]) = "1st Meeting", [1stMeeting_Participants],
        SELECTEDVALUE(MeasureGroup[Measure]) = "Duration" && SELECTEDVALUE(MeasureGroup[Group]) = "1st Meeting", [1stMeeting_Duration],
        SELECTEDVALUE(MeasureGroup[Measure]) = "Decisions" && SELECTEDVALUE(MeasureGroup[Group]) = "1st Meeting", [1stMeeting_Decisions],
        SELECTEDVALUE(MeasureGroup[Measure]) = "Participants" && SELECTEDVALUE(MeasureGroup[Group]) = "2nd Meeting", [2ndMeeting_Participants],
        SELECTEDVALUE(MeasureGroup[Measure]) = "Duration" && SELECTEDVALUE(MeasureGroup[Group]) = "2nd Meeting", [2ndMeeting_Duration],
        SELECTEDVALUE(MeasureGroup[Measure]) = "Tasks" && SELECTEDVALUE(MeasureGroup[Group]) = "2nd Meeting", [2ndMeeting_Tasks],
        BLANK()
    )

    3. Create a slicer and put MeasureGroup[Group] into slicer.

    4. Create a Matrix visual, put DateTable[Date] into Matrix Rows, MeasureGroup[Measure] into Matrix Columns, and measure SelectedMeasure into Matrix Values.

     

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.