Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Community,
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:
Solved! 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] )
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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] )
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Use SAMEPERIODLASTYEAR() - that will work for whatever time interval you show in your visual (year,quarter, month, even day)
Hi,
Yes, you could create a measure like this:
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |