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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

EOMONTH equivalent in M

Is there an equivalent of EOMONTH function in Power Query?

Or is there a work around to calculate end of month of a date for next month, and for previous month?

 

I'll highly appreciate some help.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

ok so it will be

 

Date.EndOfMonth(Date.AddMonths([Date],1))

View solution in original post

watkinnc
Super User
Super User

You could do:

LoadDate = Table.AddColumn(LastStepName, "NewColumnName", each Date.EndOfMonth(Date.AddMonths([Column2]{0}, 1))

This will increment the date by one month, and then get that end of month date.

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

4 REPLIES 4
watkinnc
Super User
Super User

You could do:

LoadDate = Table.AddColumn(LastStepName, "NewColumnName", each Date.EndOfMonth(Date.AddMonths([Column2]{0}, 1))

This will increment the date by one month, and then get that end of month date.

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
watkinnc
Super User
Super User

Yes, it's Date.EndOfMonth(DateOrDateColumn), which returns the last date in the month for each date.

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
Anonymous
Not applicable

eomonth(date,1) gives next month's end date. How would we do that in M?

Anonymous
Not applicable

ok so it will be

 

Date.EndOfMonth(Date.AddMonths([Date],1))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors