This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi all,
I am very new to PowerBI but i am building a report where one of the columns has to show the date in the format 'yyyy-mm-dd' for the prior month of when it's running, so if in march 2021 should show the first day of February 2021 in the format referred previously.
Appreciate assistance.
Best Regards,
Daniel
Solved! Go to Solution.
Hi, @danielcarreira1
Based in your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a calculated column or a measure as below.
Calculated column:
Result Column = EOMONTH([Date],-2)+1
Measure:
Result Measure = EOMONTH(SELECTEDVALUE('Table'[Date]),-2)+1
Result(You can modify the format in 'Column tools'):
Or you may go to 'Query Editor'm create a custom column with the following m codes.
Date.AddDays( Date.EndOfMonth( Date.AddMonths([Date],-2) ),1)
Then you can modify the format as you want in Power BI Desktop. Here is the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @danielcarreira1
Based in your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a calculated column or a measure as below.
Calculated column:
Result Column = EOMONTH([Date],-2)+1
Measure:
Result Measure = EOMONTH(SELECTEDVALUE('Table'[Date]),-2)+1
Result(You can modify the format in 'Column tools'):
Or you may go to 'Query Editor'm create a custom column with the following m codes.
Date.AddDays( Date.EndOfMonth( Date.AddMonths([Date],-2) ),1)
Then you can modify the format as you want in Power BI Desktop. Here is the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 26 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 37 | |
| 32 | |
| 25 | |
| 23 |