Forum Discussion

royalty123's avatar
royalty123
Regular Visitor
1 year ago
Solved

Power BI Chart - Matrix Chart

Hi All,   Please help me creating DAX measures to showcase the below request.   From a product cost perspective, where have we increased cost year over year (and to what extent) For products th...
  • v-kpoloju-msft's avatar
    1 year ago

    Hi royalty123,

    Thank you for reaching out to the Microsoft fabric community forum. Thank you lbendlindanextian, 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:
    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 Increase Measure:
    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.