I am trying to build a balance sheet in a matrix visual showing the last month (i.e. October 2022 results) compared with December values of last year (i.e. December 2021) with the header reflecting Month & Year.
I have a date table with a date column marked as date.
I managed to calculate latest month and December last year's value through the following formulas.
VAR _mon = MONTH(LASTDATE('BS'[Date]))
CALCULATE([Total Amount BS],DATESMTD(DATEADD('Date'[Date],-1*_mon,MONTH)))
Total Amount Last Date = CALCULATE([Total Amount BS],LASTDATE('BS'[Date]))
The desired outcome is to get the result to work in one measure. Appreciate the help!