Forum Discussion

AmberM's avatar
AmberM
Icon for Helper II rankHelper II
8 years ago
Solved

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