We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
@Anonymous,
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!
@Anonymous,
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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 39 | |
| 34 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |