I am trying to get the sales of Previous Year but somehow previousyear function is not giving me the desired result. [LY Sales Col] is my previous year sales column.
Go to Solution.
You need to create a calendar table and create relationship between these two tables with Date key. Then use PREVIOUSYEAR Function (DAX) like below.
LY Sales =
CALCULATE ( SUM ( SALESSHEET[Sales] ), PREVIOUSYEAR ( 'Calendar'[Date] ) )
View solution in original post
Thanks for the prompt response. Your solution worked like a charm!
I have tried changing the column for previousyear function still it is not working
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.