DAX – Getting the Start Date of the following Week
I was recently doing some work for a customer where they wanted to compare their date to the start date of the following week. They also had a requirement to persist the data to the dataset.
I thought that this would be a good challenge to use DAX with a calculated column. I most certainly could do this using the Power Query Editor and M, but I always like to see if it is possible when it is a smaller and easier DAX calculation.
Below is the DAX to get the Start date for the following week
'Date'[Date] - WEEKDAY('Date'[Date],2)+8
As you can see below, as each week goes on, I have got the start date for the following week for each day of the current week.
If I wanted to change it and use the starting date of the current week and use it for all dates for the current week, I could change it with the following DAX calculation
'Date'[Date] - WEEKDAY('Date'[Date],2)+1
As always if there are any comments or suggestions please leave them in the comments section below.