Forum Discussion
ConstMoss
Helper I
9 years agosame week last year
our week starts mon and ends sunday. when looking at sales and comparing with last year, how do we get the right dates? for example, if i want to compare this week (10/23/2017 to 10/29/2017) with l...
- 9 years ago
Hi, try with a measure like this:
VentasLY-SameWeek = CALCULATE ( SUM ( Ventas[Ventas] ), FILTER ( ALL ( Calendario ), Calendario[Año] = SELECTEDVALUE ( Calendario[Año] ) - 1 && Calendario[Semana] = SELECTEDVALUE ( Calendario[Semana] ) ) )I use a calendar table with year and week columns. (Calendario)
Regards
Victor
Lima - Peru
emadrigal
Helper II
9 years agoHi I think you will need to use the week function to get the number of the week and use it so seggregate the data.
- ConstMoss9 years ago
Helper I
thanks, I can get the week number but i how do i go back and pull the numbers for the week number last year?
- Vvelarde9 years ago
Community Champion
Hi, try with a measure like this:
VentasLY-SameWeek = CALCULATE ( SUM ( Ventas[Ventas] ), FILTER ( ALL ( Calendario ), Calendario[Año] = SELECTEDVALUE ( Calendario[Año] ) - 1 && Calendario[Semana] = SELECTEDVALUE ( Calendario[Semana] ) ) )I use a calendar table with year and week columns. (Calendario)
Regards
Victor
Lima - Peru