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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Niraj_vora0106
Helper III
Helper III

Date Calculation

Hi, community

 

I've created this DAX, For the getting dates for previous months. 

But when I'm doing m1-1, I'm not getting proper values. 

If I've selected Nov month then I should be getting 31st Oct 2021. But it's showing 30th Oct. Considering 30 days for each month.Untitled789.png

 

Any solution for this.? Because I want the Previous month's last date that's why I did m1-1. 

And "selected-max-dates = MAX(Dates)" 

 

 Untitled456.png

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Niraj_vora0106 , a measure like

 

Last date of last month = eomonth(MAX(Dates[Date]), -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

View solution in original post

Anonymous
Not applicable

Hi @Niraj_vora0106 

 

I think using EOMONTH() in your calculation will solve your problem. 

Here's the link to the documnation to help you in this:

EOMONTH function (DAX) - DAX | Microsoft Docs

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Niraj_vora0106 

 

I think using EOMONTH() in your calculation will solve your problem. 

Here's the link to the documnation to help you in this:

EOMONTH function (DAX) - DAX | Microsoft Docs

amitchandak
Super User
Super User

@Niraj_vora0106 , a measure like

 

Last date of last month = eomonth(MAX(Dates[Date]), -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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.