Forum Discussion

AaronRogers3's avatar
AaronRogers3
Helper I
8 years ago
Solved

Week commencing in DAX

Hi   Does anyone know the DAX for displaying the Week Commencing date?   I am working on a service desk based on tickets and we have a column for the date received of the ticket.   Now i would ...
  • TomMartens's avatar
    8 years ago

    Hey,

     

    just try this "simple" DAX statement

    SoWDate = 'Calendar'[Date]  - WEEKDAY('Calendar'[Date],2) +1

    The second parameter of the WEEKDAY()-function indicates if Sunday or Monday is your first day of the week, for me this works like a charm, maybe you have to use a different correction part.

     

    Just using your Date column and the "Day of Week" column helps to adjust the above mentioned formula if necessary.

     



    and this calculates the End Date of the week

    EoWDate = 'Calendar'[Date] + 7 - WEEKDAY([DATE],2)

     

    Hope this helps

    Regards