Forum Discussion
Get all values from week beginning with overlapping weeks from two months
- 2 years ago
Step 0: I use your data below. (Date:yyyy/mm/dd)
Step 1: I make a measure.
In this measure, I compare the month number of the first day of the week to the month number of four days after the first day of the week.
the first day of the week --> Monday
four days after the first day of the week --> Friday
M_W Num Cal = IF(MONTH(MAX('DATA'[Week Beginning]))<>MONTH(DATE(YEAR(MAX('DATA'[Week Beginning])),MONTH(MAX('DATA'[Week Beginning])),4+DAY(MAX('DATA'[Week Beginning])))),1, 1+MAX('DATA'[Week Number])-WEEKNUM(DATE(YEAR(MAX('DATA'[Week Beginning])),MONTH(MAX('DATA'[Week Beginning])),1)))Step 2: I make a table. - Anonymous2 years ago
Hi socal225 ,
Your solution is great, mickey64 . Here I have another idea in mind, and I would like to share it for reference.
1.Create simple data:
2.Create new measures:
WENK END = SELECTEDVALUE('Table'[Week Beginning])+6 Week number of month = VAR _month = MONTH(SELECTEDVALUE('Table'[Week Beginning])+6) RETURN RANKX(FILTER(ALL('Table'), MONTH('Table'[WENK END]) = _month), [WENK END], , ASC, Dense)3.The result is as follows:
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi socal225 ,
Your solution is great, mickey64 . Here I have another idea in mind, and I would like to share it for reference.
1.Create simple data:
2.Create new measures:
WENK END = SELECTEDVALUE('Table'[Week Beginning])+6
Week number of month =
VAR _month = MONTH(SELECTEDVALUE('Table'[Week Beginning])+6)
RETURN
RANKX(FILTER(ALL('Table'), MONTH('Table'[WENK END]) = _month), [WENK END], , ASC, Dense)
3.The result is as follows:
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!