Forum Discussion
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.
Hi warren_lucas
Please tefer to the linked video guide :
https://www.youtube.com/watch?v=cAxoxvnN_vQIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
6 Replies
- Ashish_Mathur
Super User
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.
- Ritaf1983
Super User
Hi warren_lucas
Please tefer to the linked video guide :
https://www.youtube.com/watch?v=cAxoxvnN_vQIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- AnonymousNot 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 - AnonymousNot 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
- AnonymousNot 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
Community 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)