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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Endofmonth based on month/year column

Hi all, 

 

Can anyone help me tell me what the best way is to add a column with end-of-month based on a yyymm-column. I would like to add a date-column for using datefilters. 

 

What is the most efficient way to achieve this? 

 

Thanks in advance!

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

1. Use below formula in Power Query, replace Date with your column name

= Date.EndOfMonth(Date.FromText(Text.From([Date])&"01"))

2. If you are planning to use DAX

= EOMONTH(DATE(LEFT([Date],4),RIGHT([Date],2),1),0)

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

1. Use below formula in Power Query, replace Date with your column name

= Date.EndOfMonth(Date.FromText(Text.From([Date])&"01"))

2. If you are planning to use DAX

= EOMONTH(DATE(LEFT([Date],4),RIGHT([Date],2),1),0)
Anonymous
Not applicable

Thanks! Exactly what I need. 

Cookistador
Super User
Super User

Hello,
You can do it via Dax or in Power query, if you want to do it in power query, it is possible to do via M with something like

Cookistador_0-1655200008507.png

#date(Number.FromText(Text.Start(Text.From([Column1], "en-GB"), 4)),Number.FromText(Text.End(Text.From([Column1], "en-GB"), 2)),31)

 

#date required 3 parameters year, month and day, 
You can extract Year and month via your yyyymm column, you convert this text to number and it should work

 

Anonymous
Not applicable

Thanks, I'll try this, however end-of-month is not always 31. I will use your formula in a Date.EndOfMonth-function and change the day value to 1.

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.