Forum Discussion
Weekly sales
Hi Anonymous
You haven't copied my code correctly. The second check is on [Week of the year], not on [year]
Week of the year 2 =
IF (
( Table1[year] = 2019 && Table1[ Week of the year] = 53 )
|| ( Table1[year] = 2020 && Table1[ Week of the year] = 1 );
1;
Table1[ Week of the year]
)
How to change the DAX expression like adding expression of changing 53th of 2020 into 1st week of 2020?
thanks again
- AlB6 years ago
Community Champion
Anonymous
Try this for your column WeekYear
WeekYear = IF ( ( Table1[year] = 2019 && Table1[ Week of the year] = 53 ) || ( Table1[year] = 2020 && Table1[ Week of the year] = 1 ); "1-2020"; Table1[ Week of the year] & "-" & Table1[year] )Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers

- AlB6 years ago
Community Champion
With the code for WeekYear in the previous post, you don't need the [Week of the year 2] column any more
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers

- Anonymous6 years agoNot applicable
Thank you for your answer.
But my question was
How should i add more years on the DAX expression?
For example 2021, 2022...
Week of the year 2 =
IF (
( Table1[year] = 2019 && Table1[ Week of the year] = 53 )
|| ( Table1[year] = 2020 && Table1[ Week of the year] = 1 );
1;
Table1[ Week of the year]
)- AlB6 years ago
Community Champion
Anonymous
Try this
Week of the year 2 V2 = IF ( Table1[ Week of the year] = 53; 1; Table1[ Week of the year] )Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
