Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am using a Matrix Table, but totals don't add up correctly. How to add up each month as the total number with the .MTD formattedMeasure? I am open to changing my approach if needed.
Solved! Go to Solution.
Try this measure that uses SUMX to iterate the Month Year values in the filter context.
.MTD formattedMeasure =
VAR _salesMeasure =
SUMX ( VALUES ( 'FY Calender'[Month Year] ), [MTD] )
VAR _result =
SWITCH (
TRUE (),
ABS ( _salesMeasure ) > 1000000000, FORMAT ( _salesMeasure, "\$#,,,.0B;(\$#,,,.0B)" ),
ABS ( _salesMeasure ) > 1000000, FORMAT ( _salesMeasure, "\$#,,.0M;(\$#,,.0M)" ),
ABS ( _salesMeasure ) >= 1000, FORMAT ( DIVIDE ( _salesMeasure, 1000, 0 ), "$"".""#K;($"""",,#K)" ),
ABS ( _salesMeasure ) > 0, FORMAT ( _salesMeasure, "\$"".""#,##0.00;(\$#,##0.00K)" ),
ABS ( _salesMeasure ) = 0, FORMAT ( _salesMeasure, "0" )
)
RETURN
_result
Proud to be a Super User!
Try this measure that uses SUMX to iterate the Month Year values in the filter context.
.MTD formattedMeasure =
VAR _salesMeasure =
SUMX ( VALUES ( 'FY Calender'[Month Year] ), [MTD] )
VAR _result =
SWITCH (
TRUE (),
ABS ( _salesMeasure ) > 1000000000, FORMAT ( _salesMeasure, "\$#,,,.0B;(\$#,,,.0B)" ),
ABS ( _salesMeasure ) > 1000000, FORMAT ( _salesMeasure, "\$#,,.0M;(\$#,,.0M)" ),
ABS ( _salesMeasure ) >= 1000, FORMAT ( DIVIDE ( _salesMeasure, 1000, 0 ), "$"".""#K;($"""",,#K)" ),
ABS ( _salesMeasure ) > 0, FORMAT ( _salesMeasure, "\$"".""#,##0.00;(\$#,##0.00K)" ),
ABS ( _salesMeasure ) = 0, FORMAT ( _salesMeasure, "0" )
)
RETURN
_result
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 137 | |
| 102 | |
| 71 | |
| 67 | |
| 65 |