Forum Discussion

Stabben23's avatar
Stabben23
Icon for Helper I rankHelper I
4 years ago
Solved

Flag in Calendar

I want to build a flag (0,1) in my calendar based on, if it is current week and monday, then add 1 to previous week dates else 0. if it is current week and >Monday then add 1 to current week. So if...
  • v-kkf-msft's avatar
    4 years ago

    Hi Stabben23 ,

     

    Please try the column:

     

    Flag = 
    VAR currentDay =
        TODAY ()
    VAR IsMonday =
        IF ( [Date] < currentDay, 1, 0 )
    VAR IsNotMonday =
        IF ( WEEKNUM ( currentDay, 2 ) = WEEKNUM ( [Date], 2 ), 1, 0 )
    RETURN
        IF ( WEEKDAY ( currentDay, 2 ) = 1, IsMonday, IsNotMonday )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.