Forum Discussion
Different format for measure per row
- Anonymous1 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.
Hi,
Thanks for the solution FarhanJeelani and FreemanZ offered, and i want to offer some more information for user to refer to.
hello joshua1990, you can use dynamic format, you can create a new measure.
Format_measure = IF(SELECTEDVALUE('Table'[Group]) in {"A","C"},"#,##0,.0 K")
Then click the measure1 and measure2, select Measure tool->format->dynamic
Then you can put the format measure to the related field.
Output
You can refer to the following link about the dynamic format.
Create dynamic format strings for measures in Power BI Desktop - Power BI | Microsoft Learn
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.
THanks a lot Anonymous.
Is it possible to get the total in thousand as well?
- Anonymous1 year agoNot applicable
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.