Forum Discussion
BarryWhitelaw
1 year agoRegular Visitor
Simple Matrix with Variance
HI there I am a very new user to Power Bi, and struggling with something I thought must be a simple visualization. For my data I need to show a matrix, years in the columns and months in the ...
- 1 year ago
Hello BarryWhitelaw
Try these measure
1.Total Spend = SUM('Table'[Spend])
2.Previous Year Spend =
CALCULATE(
[Total Spend],
SAMEPERIODLASTYEAR('Table'[Date])
)3.Variance =
[Total Spend] - [Previous Year Spend]
4.Variance =
VAR Curr = [Total Spend]
VAR Prev = [Previous Year Spend]
RETURN
IF(
NOT ISBLANK(Curr) && NOT ISBLANK(Prev),
Curr - Prev
)
If my response helped you, please consider clicking
Accept as Solution ✅ and giving it a Like 👍 – it helps others in the community too.
Thanks,
Connect with me on:
LinkedIn - 1 year ago
Please try the approaches in the attached pbix.
Selected years:
Max and previous years:
danextian
1 year agoSuper User
Please try the approaches in the attached pbix.
Selected years:
Max and previous years: