Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
danielcarreira1
Regular Visitor

Column name to show date of prior month that when report is running

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

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @danielcarreira1 

 

Based in your description, I created data to reproduce your scenario. The pbix file is attached in the end. 

Table:

a1.png

 

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'):

a3.png

a2.png

 

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.

a5.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @danielcarreira1 

 

Based in your description, I created data to reproduce your scenario. The pbix file is attached in the end. 

Table:

a1.png

 

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'):

a3.png

a2.png

 

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.

a5.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@danielcarreira1 , You can try measure like

eomonth(max(Date[Date]),-2)+1

 

or

 

eomonth(today(),-2)+1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors