Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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...
  • Mariusz's avatar
    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.