Forum Discussion
SAMEPERIODLASTYEAR - Charting with Month End Values
I have a aggregated month end value to show along with the aggregated month end of the prior year's month value. These are not cumulative values, we need to show what the value is at the end of each month with that same value 12 months ago.
I have the calendar table setup correctly.
The issue I am having is that I can only get the SAMEPERIODLASTYEAR value to work if I am using the default date hierarchy on my datekey calendar field.
If I remove year and/or quarter the prior value is the same as the current value which I understand is likely because DAX is evaulating the period without a year or quarter context. The only way I can get the prior value to work at the month level on a bar chart is to drill down from year -> month -> quarter. The problem with this is that I need to see more than three months at a time.
How do I display several month values in this formula without being locked into three months in a particular quarter?
Here are my measures
TotalValues = SUM(AccountSecurityMonthEndValues[Value])
Prior Year Values = CALCULATE([TotalValues], SAMEPERIODLASTYEAR('Calendar'[DateKey]))
This is what it looks like when I drill down to month with the date hierarchy intact. Again, this is correct, but I need to show more months than those within a current quarter.
hi, you can go to next level with the icon with double arrow and Concatenate to X Axis to OFF
4 Replies
- VvelardeCommunity Champion
hi, you can go to next level with the icon with double arrow and Concatenate to X Axis to OFF