Forum Discussion
dkay84_PowerBI
9 years agoMicrosoft Employee
DAX help
I am trying to calculate sales YTD (using week number) vs. sales Last Year YTD. I can't use SAMEPERIODLASTYEAR because I have a custom FY calendar. My data will only ever have the current FY (YTD) ...
- 9 years ago
hi, With this modifcation should be work.
Last YTD Sales = VAR LY = [Last Year] VAR LW = [Latest Week YTD] RETURN CALCULATE ( SUM ( Table1[Sales] ), FILTER ( ALL ( Table1 ), Table1[FY] = LY && Table1[Week Number] <= LW ) )
Vvelarde
9 years agoCommunity Champion
hi, With this modifcation should be work.
Last YTD Sales =
VAR LY = [Last Year]
VAR LW = [Latest Week YTD]
RETURN
CALCULATE (
SUM ( Table1[Sales] ),
FILTER ( ALL ( Table1 ), Table1[FY] = LY && Table1[Week Number] <= LW )
)