Forum Discussion
Anonymous
6 years agoNot applicable
Week grouping
Hi guys, I'm trying to group my dates by week and used the Grouping function and it worked ok. But I'd like to group by the week ending date and not by the week starting like it is doing right no...
- 6 years ago
Hi Anonymous
Try this Column.
Column 2 = VAR __yearWeek = FORMAT( 'Calendar'[Date], "YYYYWW" ) RETURN CALCULATE( MAX( 'Calendar'[Date] ), ALL( 'Calendar' ), FORMAT( 'Calendar'[Date], "YYYYWW" ) = __yearWeek )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Mariusz
6 years agoCommunity Champion
Hi Anonymous
Try this Column.
Column 2 =
VAR __yearWeek = FORMAT( 'Calendar'[Date], "YYYYWW" )
RETURN
CALCULATE(
MAX( 'Calendar'[Date] ),
ALL( 'Calendar' ),
FORMAT( 'Calendar'[Date], "YYYYWW" ) = __yearWeek
)
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Mariusz
If this post helps, then please consider Accepting it as the solution.
Anonymous
6 years agoNot applicable
Mariusz thank you! this worked!
- Anonymous6 years agoNot applicable
Mariusz sorry to go back to this but the calculation seems to have an issue with the year end. For example it groups the week of 12/28 (from 12/22 to 12/28) and then it groups 29,30,31/12 as 31/12 and then 01,02,03,04/01 as another group. Do you have any idea on how to fix this? Thank you!!