Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
PREVIOUSMONTH('Query1[Date_field]) not working [Date_field] references a column in the table, but no returns of prior month of the date?
Solved! Go to Solution.
Hi @JulieL4108
If you want to add a calculated column by dax,You can use edate() function.
e.g
Column =
EDATE ( 'Query1'[Date_field], -1 )
Output
If you want to implement it in power query, you can add a custom column and input the following code
Date.AddMonths([Date_field],-1)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Apologies I am new and may not have asked the question properly. I have a date column and want to create a new date column 1 month prior than the original date column.
Hi @JulieL4108
If you want to add a calculated column by dax,You can use edate() function.
e.g
Column =
EDATE ( 'Query1'[Date_field], -1 )
Output
If you want to implement it in power query, you can add a custom column and input the following code
Date.AddMonths([Date_field],-1)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you! I kept adding in 'm' in the front of the field EDATE('m','Query1'[date_field],-1) thinking I needed to indicate month and kept receiving an error.
EDATE (<column> , -1 )
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
31 | |
31 | |
20 | |
15 | |
12 |
User | Count |
---|---|
18 | |
16 | |
16 | |
9 | |
9 |