Forum Discussion

warren_lucas's avatar
warren_lucas
New Member
1 year ago
Solved

YoY measures - per year

Hi all,

Very new to desktop BI.

I have a data base of invoice transactons, date, rep, sales value.

what I am after to a measure to shop the difference per month, year on year.

Its very basic, froma  one drive excel file linked to bi.

I can get this far

 

how would one now put a colmn in, 2023vs2024 with a subtotal at the bottom?

Thank you

  • Hi,

    Assuming you already have a Calendar table with year and Month name from that table being dragged to your matrix visual, write these measures

    Total = sum(Data[Value])

    Total in pm = calculate([Total],previousmonth(calendar[date])

    Variance = [Total]-[Total in pm]

    Hope this helps.

6 Replies

  • Hi,

    Assuming you already have a Calendar table with year and Month name from that table being dragged to your matrix visual, write these measures

    Total = sum(Data[Value])

    Total in pm = calculate([Total],previousmonth(calendar[date])

    Variance = [Total]-[Total in pm]

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi warren_lucas,

     

    Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to Ritaf1983 and Ashish_Mathur  for prompt and helpful responses.

     

    Just following up to see if the solutions provided by community members were helpful in addressing the issue.

    If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.

     

    Best regards,
    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi warren_lucas,

     

    Just following up to see if the responses provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

     

    Best regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi warren_lucas,

     

    Just following up to see if the responses provided by community members were helpful in addressing the issue.

    If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.

     

    Best regards,
    Prasanna Kumar

  • Shahid12523's avatar
    Shahid12523
    Icon for Community Champion rankCommunity Champion

    YoY Difference Measure (DAX)
    YoY Diff = [Total Sales] - CALCULATE([Total Sales], SAMEPERIODLASTYEAR('DateTable'[Date]))


    Matrix Setup
    - Rows: Month
    - Columns: Year
    - Values: Total Sales, YoY Diff
    Power BI will auto-calculate subtotals at the bottom. You can add a slicer to focus on 2023 vs 2024.
    Want a % change too? Just add:


    YoY % = DIVIDE([YoY Diff], CALCULATE([Total Sales], SAMEPERIODLASTYEAR('DateTable'[Date]), 0)