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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Dax - Max date by Month

I have a table that is tracking weekly snapshots for Monthly Sales Forecast. Based on the month that is displayed, I want it to show the data for the last snapshot. I assume it needs to use some form of MAX. Right now I'm working with a custom field that is adding a flag for the max Forecast Date:

MaxForecastDate = if(max('Monthly Forecast'[ForecastDate])='Revenue Monthly Forecast'[ForecastDate],1,0)
 
However, I think I need this to be a measure so it'll be dynamic based on the month I have displayed (Report filters by month, so it's fine for this month (Sept) because the MaxForecastDate =1 where ForecastDate=9/2/20, but if I switch to last month it just shows blank - no MaxForecastDate=1 for any of the August forecast records). 
smileamile_0-1599167656994.png

 

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 
You need to check the max forecast date for each period, try create this column. 

 

Column = IF([Forecast Date]=CALCULATE(MAX([Forecast Date]),ALLEXCEPT('Table','Table'[Period])),1,0)
maxforecast.JPG
 
Paul Zheng _ Community Support Team
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

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format?

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
Anonymous
Not applicable

@amitchandak  @Pragati11 Here is what I have and what I'm looking for (not sure how to put data in a sample output table). For each period, I need the max Forecast Date.

smileamile_0-1599138503238.png

 

 

Anonymous
Not applicable

@Anonymous 
You need to check the max forecast date for each period, try create this column. 

 

Column = IF([Forecast Date]=CALCULATE(MAX([Forecast Date]),ALLEXCEPT('Table','Table'[Period])),1,0)
maxforecast.JPG
 
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Can you share additional details like sample data, screenshots, etc.?

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.