Forum Discussion
Power BI Chart - Matrix Chart
- 1 year ago
Hi royalty123,
Thank you for reaching out to the Microsoft fabric community forum. Thank you lbendlin, danextian, for your inputs on this issue.
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.
Date Table Dax:
CalendarTable = ADDCOLUMNS(
CALENDAR(MIN(Data[Date]), MAX(Data[Date])),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMM")
)
Previous Year’s Cost Measure:Prev_Year_Cost = CALCULATE(SUM(Data[Cost]), SAMEPERIODLASTYEAR(CalendarTable[Date]))
Cost Increase YoY Measure:
Sales Growth from Cost Increase Measure:Cost_Change_YoY = SUM(Data[Cost]) - [Prev_Year_Cost]
Previous Year’s Quantity Measure:
Prev_Year_Qty = CALCULATE(SUM(Data[Quantity]), SAMEPERIODLASTYEAR(CalendarTable[Date]))
Sales_Growth_from_Cost = [Cost_Change_YoY] * [Prev_Year_Qty]Sales Growth from Quantity Increase Measure:
Sales_Growth_from_Qty = SUMX(Data, Data[Cost] * (Data[Quantity] - Data[Prev_Year_Qty]))
I am also including .pbix file for your better understanding, please have a look into it:
I hope this could resolve your issue, if you need any further assistance, feel free to reach out. If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
No need for measures. You can visualize this without code.