Forum Discussion

joshua1990's avatar
joshua1990
Post Prodigy
1 year ago
Solved

Different format for measure per row

I have a matrix that shows different measures for individual groups. The groups are segmented on the rows: Group Measure 1 Measure 2 A 1K 3K B 500 300 C 2K 3K Total 3.5K 6....
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi joshua1990 

    You can refer to the following solution.

    1.Create a new table, there is no relationship between the tables.

    Table 2 = var a=VALUES('Table'[Group])
    var b={"Total"}
    return UNION(a,b)

    2.Create the following measures.

    Measure3 =
    IF (
        SELECTEDVALUE ( 'Table 2'[Group] ) <> "Total",
        CALCULATE ( [Measure], 'Table'[Group] IN VALUES ( 'Table 2'[Group] ) ),
        SUMX ( ALLSELECTED ( 'Table'[Group] ), [Measure] )
    )
    
    Measure4 =
    IF (
        SELECTEDVALUE ( 'Table 2'[Group] ) <> "Total",
        CALCULATE ( [Measure 2], 'Table'[Group] IN VALUES ( 'Table 2'[Group] ) ),
        SUMX ( ALLSELECTED ( 'Table'[Group] ), [Measure 2] )
    )
    

    Then change the format measure to the following.

    Format_measure = IF(SELECTEDVALUE('Table 2'[Group]) in {"A","C","Total"},"#,##0,.0 K")

    Then put the format measure to the format of measure3 and measure4.  and create a matrix visual ,and put the field of table(2) to the row ,and put the measure3 and measure4 to the value, and close the row subtotals.

     

     

    Output

     

    Best Regards!

    Yolo Zhu

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