Forum Discussion
Total Issue in Matrix Visual in Power BI
DAX Caluclations:
Hi jeeva_chandru,
The row/column totals in your
M-Sufficency_Amount($M)matrix are wrong because the DAX measures inside (M-Conversion_Rate,M-CompletedSales_Debug, etc.) are row-context dependent (they rely onMAX()andLOOKUPVALUE()), and totals don’t have the same filter context as each cell.Try below DAX
M-Conversion_Rate =
VAR CurrentYear = YEAR(TODAY())
RETURN
SUMX(
VALUES(AOP_EDW_MERGED[Vertical]),
VAR _Vertical = AOP_EDW_MERGED[Vertical]
RETURN
SUMX(
VALUES(AOP_EDW_MERGED[Region]),
VAR _Region = AOP_EDW_MERGED[Region]
VAR _CompletedSales =
CALCULATE(
SUMX(
FILTER(
AOP_EDW_MERGED,
YEAR(AOP_EDW_MERGED[EDW_Pipeline.COMPLETION DATE]) = CurrentYear &&
AOP_EDW_MERGED[SALES STAGE ID] = 9
),
AOP_EDW_MERGED[EDW_Pipeline.Est. Sell Price]
)
) / 1000000
VAR _OtherSales =
CALCULATE(
SUMX(
FILTER(
AOP_EDW_MERGED,
YEAR(AOP_EDW_MERGED[EDW_Pipeline.COMPLETION DATE]) = CurrentYear &&
NOT AOP_EDW_MERGED[SALES STAGE ID] IN {7,8,9}
),
AOP_EDW_MERGED[EDW_Pipeline.Est. Sell Price]
)
) / 1000000
VAR _AvgConvRate =
CALCULATE(
AVERAGE('Conversion Rate'[CONVERSIONRATE]),
'Conversion Rate'[Vertical] = _Vertical,
'Conversion Rate'[Region] = _Region
)
RETURN
_CompletedSales + (_OtherSales * _AvgConvRate)
)
)🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
2 Replies
- grazitti_sapnaSuper User
Hi jeeva_chandru,
The row/column totals in your
M-Sufficency_Amount($M)matrix are wrong because the DAX measures inside (M-Conversion_Rate,M-CompletedSales_Debug, etc.) are row-context dependent (they rely onMAX()andLOOKUPVALUE()), and totals don’t have the same filter context as each cell.Try below DAX
M-Conversion_Rate =
VAR CurrentYear = YEAR(TODAY())
RETURN
SUMX(
VALUES(AOP_EDW_MERGED[Vertical]),
VAR _Vertical = AOP_EDW_MERGED[Vertical]
RETURN
SUMX(
VALUES(AOP_EDW_MERGED[Region]),
VAR _Region = AOP_EDW_MERGED[Region]
VAR _CompletedSales =
CALCULATE(
SUMX(
FILTER(
AOP_EDW_MERGED,
YEAR(AOP_EDW_MERGED[EDW_Pipeline.COMPLETION DATE]) = CurrentYear &&
AOP_EDW_MERGED[SALES STAGE ID] = 9
),
AOP_EDW_MERGED[EDW_Pipeline.Est. Sell Price]
)
) / 1000000
VAR _OtherSales =
CALCULATE(
SUMX(
FILTER(
AOP_EDW_MERGED,
YEAR(AOP_EDW_MERGED[EDW_Pipeline.COMPLETION DATE]) = CurrentYear &&
NOT AOP_EDW_MERGED[SALES STAGE ID] IN {7,8,9}
),
AOP_EDW_MERGED[EDW_Pipeline.Est. Sell Price]
)
) / 1000000
VAR _AvgConvRate =
CALCULATE(
AVERAGE('Conversion Rate'[CONVERSIONRATE]),
'Conversion Rate'[Vertical] = _Vertical,
'Conversion Rate'[Region] = _Region
)
RETURN
_CompletedSales + (_OtherSales * _AvgConvRate)
)
)🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together! - jeeva_chandruNew Member
grazitti_sapna Thank you so much, it worked yeahhhhhhhhhhhhh....