Skip to main content
Announcements
Applications are open for the 2024 Qlik Luminary Program. Apply by December 15 here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vicente89
Contributor
Contributor

Get the data for the same day of the same week of the same week last year.

I want to get the data for the same day of the same week of the same week last year. Example:
Today is: Wednesday, October 3, week 40 of 2023.
I want: Wednesday (October 2 in this case) of week 40 of 2022.

I have tried the following formulas and they don't work:
- SUM({<fecha_creacion_del_pago={'$(=Date(YearStart(Today()) - 1) + WeekDay(Today()) - WeekDay(Today(1)) - 7))'}>} venta_neta_reserva)
- SUM({<fecha_creacion_del_pago={'$(=Date(WeekStart(Today()) - 365 + WeekDay(Today()) - 1))'}>} venta_neta_reserva)
- SUM({<fecha_creacion_del_pago={'$(=AsOfDate(Today(), -364))'}>} venta_neta_reserva)

In Power BI it could be the following formula:
"totalsales DATEADD = CALCULATE([Total Sales], dateadd('Date'[Date], -364, DAY))".

1 Reply
jochem_zw
Partner Ambassador
Partner Ambassador

Please try something like this:

SUM({<fecha_creacion_del_pago={"$(=Date(Today() -364))"}>} venta_neta_reserva)