Forum Discussion
Year on Year Calculations
- 8 years ago
Hi dapperscavenger,
Assuming you have a date table related with your main data add the following measures:
TotalMTD = TOTALMTD(SUM(Data[ShipmentsVolumeEUs]);DimDate[Date]) TotalMTDPY = TOTALMTD ( SUM ( Data[ShipmentsVolumeEUs] ); SAMEPERIODLASTYEAR ( DimDate[Date] ) ) YOY = IF ( [TotalMTDPY] = BLANK (); BLANK (); [TotalMTD] - [TotalMTDPY] ) YOY% = IF([TotalMTDPY] = BLANK();BLANK();[YOY]/[TotalMTDPY]+1)Last measure format as % final result below:
Regards,
MFelix
- 8 years ago
Hi dapperscavenger,
You need to have a date column on the measure something like this:
TotalMTDPY = TOTALMTD(SUM(FinalReport[ShipmentsVolumeEUs]),SAMEPERIODLASTYEAR(FinalReport[MonthYear]))
Do you have the column MonthYear as a date if so the above formula should work.
Regards,
MFelix
Hi dapperscavenger,
Assuming you have a date table related with your main data add the following measures:
TotalMTD = TOTALMTD(SUM(Data[ShipmentsVolumeEUs]);DimDate[Date])
TotalMTDPY =
TOTALMTD (
SUM ( Data[ShipmentsVolumeEUs] );
SAMEPERIODLASTYEAR ( DimDate[Date] )
)
YOY = IF ( [TotalMTDPY] = BLANK (); BLANK (); [TotalMTD] - [TotalMTDPY] )
YOY% = IF([TotalMTDPY] = BLANK();BLANK();[YOY]/[TotalMTDPY]+1)Last measure format as % final result below:
Regards,
MFelix
Thanks MFelix
I can't quite get the second measure. I have:
TotalMTDPY = TOTALMTD(SUM(FinalReport[ShipmentsVolumeEUs]),SAMEPERIODLASTYEAR(FinalReport[MonthYear].[Date]))
What have I done wrong?
Thank you!
- MFelix8 years ago
Super User
Hi dapperscavenger,
You need to have a date column on the measure something like this:
TotalMTDPY = TOTALMTD(SUM(FinalReport[ShipmentsVolumeEUs]),SAMEPERIODLASTYEAR(FinalReport[MonthYear]))
Do you have the column MonthYear as a date if so the above formula should work.
Regards,
MFelix
- dapperscavenger8 years ago
Helper V
Brilliant, it did the trick! Thank you!