I have the following report:
So far I have created a measure that gives me prior year's sales amount if I select e.g the year 2013 I will get last year's amount of 2.64.
The measure is:
Go to Solution.
You can use this SPLY measure once you make these changes to your model/file.
1. Turn off Auto Date/Time in Options
2. Convert your Calendar[DateKey] to type Date instead of DateTime
3. On the Table tools tab, Mark your Calendar table as a Date table using the DateKey field to validate.
SPLY =CALCULATE ( SUM ( Sales[SalesAmount] ), SAMEPERIODLASTYEAR ( 'Calendar'[DateKey] ))
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
View solution in original post
Use SAMEPERIODLASTYEAR() - that will work for whatever time interval you show in your visual (year,quarter, month, even day)
Yes, you could create a measure like this:
Learn how to create your own user groups today!
Click here to read more about the November 2021 Updates!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.