Forum Discussion
Looking for correct SQL for Previous Month of Column to create a new column
- Anonymous2 years ago
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.
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.