Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Week Num | Year | Date | Observations | WTD |
1 | 2019 | 01/01/2019 | 1 | |
1 | 2019 | 02/01/2019 | 1 | |
1 | 2019 | 03/01/2019 | 1 | |
1 | 2019 | 04/01/2019 | 1 | |
1 | 2019 | 05/01/2019 | 1 | |
1 | 2019 | 06/01/2019 | 215 | 1 |
2 | 2019 | 07/01/2019 | 1 | |
2 | 2019 | 08/01/2019 | 1 | |
2 | 2019 | 09/01/2019 | 1 | |
2 | 2019 | 10/01/2019 | 1 | |
2 | 2019 | 11/01/2019 | 1 | |
2 | 2019 | 12/01/2019 | 1 | |
2 | 2019 | 13/01/2019 | 280 | 1 |
1 | 2020 | 01/01/2020 | 1 | |
1 | 2020 | 02/01/2020 | 1 | |
1 | 2020 | 03/01/2020 | 1 | |
1 | 2020 | 04/01/2020 | 1 | |
1 | 2020 | 05/01/2020 | 189 | 1 |
2 | 2020 | 06/01/2020 | 1 | |
2 | 2020 | 07/01/2020 | 1 | |
2 | 2020 | 08/01/2020 | 1 | |
2 | 2020 | 09/01/2020 | 1 | |
2 | 2020 | 10/01/2020 | 1 | |
2 | 2020 | 11/01/2020 | 1 | |
2 | 2020 | 12/01/2020 | 275 | 1 |
Solved! Go to Solution.
The inbuilt time intelligence functions that you are using work on dates, not week numbers. So 3 Jan May be week 2 one year and week 1 the year after (for example). If you want to report on like for like week numbers, you need to write a custom time intelligence function. Read my article here
https://exceleratorbi.com.au/dax-time-intelligence-beginners/
Hi @BlueSky,
As MattAllington said, time intelligence functions not suitable for your scenario. I'd like to suggest you extract current 'year' and 'week num' as condition parameter to filter records:
Last Year =
VAR currYear =
MAX ( MockUp[Year] )
RETURN
CALCULATE (
MAX ( MockUp[Observations] ),
FILTER ( ALLSELECTED ( MockUp ), [Year] = currYear - 1 ),
VALUES ( MockUp[Week Num] )
)
Regards,
Xiaoxin Sheng
The inbuilt time intelligence functions that you are using work on dates, not week numbers. So 3 Jan May be week 2 one year and week 1 the year after (for example). If you want to report on like for like week numbers, you need to write a custom time intelligence function. Read my article here
https://exceleratorbi.com.au/dax-time-intelligence-beginners/
Thanks Matt, very well written blog post, helped a lot.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |