Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone,
I'm creating a date table with a 'Date' column and I want to add a 'Date N-1' column corresponding to the same day (Monday, Tuesday, Wednesday...) of the same week of the previous year.
For example, if I take Wednesday May 1, 2024, I want Wednesday May 3, 2023.
I work with week in ISO format.
Thank you
Solved! Go to Solution.
Hi @v-zhouwen-msft,
Thanks for your reply, but this formula won't work in 2025, as my screenshot shows.
I've found an alternative solution which consists in creating my date table with these two columns in a csv file instead of generating it with M or DAX.
Hi @Fardy ,
Please follow these steps:
1. Use the following DAX expression to create a column
Date N-1 =
VAR _a = WEEKNUM([Date],2)
VAR _b = WEEKDAY([Date],2)
VAR _c = DATE(YEAR([Date])-1,1,1) + (_a-1) * 7 + _b
RETURN _c
2.Final output
Hi @v-zhouwen-msft,
Thanks for your reply, but this formula won't work in 2025, as my screenshot shows.
I've found an alternative solution which consists in creating my date table with these two columns in a csv file instead of generating it with M or DAX.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
112 | |
62 | |
54 | |
38 |