Forum Discussion
Same Period Last Year for Fiscal Week Nbr
I am trying to create a expression to compare sameperiodlastyear at a fiscal week level.
The calculation I tried (below) does not return the correct value.
Total Sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR( Dates[Date] ) )
My data is at a fiscal week level, not at a date level.
For example, I need to compare Fiscal Week 201701 to Fiscal Week 201601, but the fiscal week begins in March. I haven't been able to find a solution that seems to work. Help!
Here is the calculation thanks to Enterprise DNA, but it doesn't produce totals for a table, just by week number in the table.
https://www.youtube.com/watch?v=aODroF37pq0
Previous Year Sales = VAR CurrentWeek = SELECTEDVALUE( Dates[Week Number] ) VAR CurrentYear = SELECTEDVALUE( Dates[Year] ) RETURN CALCULATE( [Total Sales], FILTER( ALL( Dates ), Dates[Week Number] = CurrentWeek && Dates[Year] = CurrentYear - 1))
2 Replies
- v-xjiin-msft
Solution Sage
Hi AmberM,
In your scenario, to custom Fiscal Week. I think you can refer to this relevant thread:
https://community.powerbi.com/t5/Desktop/Custom-Fiscal-Year-Calendar/td-p/85228
Thanks,
Xi Jin. - AmberM
Helper II
Here is the calculation thanks to Enterprise DNA, but it doesn't produce totals for a table, just by week number in the table.
https://www.youtube.com/watch?v=aODroF37pq0
Previous Year Sales = VAR CurrentWeek = SELECTEDVALUE( Dates[Week Number] ) VAR CurrentYear = SELECTEDVALUE( Dates[Year] ) RETURN CALCULATE( [Total Sales], FILTER( ALL( Dates ), Dates[Week Number] = CurrentWeek && Dates[Year] = CurrentYear - 1))