Forum Discussion

StephenF's avatar
StephenF
Responsive Resident
3 years ago
Solved

Weekofyear doesnt work

Its telling me 1st of jan 2023 is week 1, its not, its week 53.   I'm in Europe.   Whats a fix I can use as a custom column in the query editor?    
  • v-zhangti's avatar
    3 years ago

    Hi, StephenF 

     

    This is the default result in DAX functions.

    If you want January 1, 2023 to be week 53, you can try this method.

    Week = 
    IF (
        [Date] = DATE ( 2023, 1, 1 ),
        WEEKNUM ( [Date] - 1, 2 ),
        IF ( [Date] > DATE ( 2023, 1, 1 ), WEEKNUM ( [Date], 2 ) - 1, [Weeknum] )
    )

    Hope that can help you.

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.