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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sergiod04
Frequent Visitor

ENDOFMONTH + Most Recent Date

Hello, 

 

I have a table which brings back values for the last date of the month and the most recent date available in the data set. For example, if the most recent date in the data set is 8/10/2020, it will bring back: 

                         06/30/2020         07/31/2020         8/10/2020 

Dimension 1          345                     450                    465

Dimension 2         1,350                   756                    820

 

im doing it with the following formula: 

Measure = CALCULATE (SUM(VALUE), FILTER(DATE_TABLE,DATE_TABLE[Date] = ENDOFMONTH(DATE_TABLE[Date])))
 
The problem is that if i select 8/8/2020 as a filter for my max date (not the most recent date in my calendar table), i get this: 
 

                         06/30/2020         07/31/2020       

Dimension 1          345                     450                   

Dimension 2         1,350                   756               

 

where the desired product would be this: 

 

                         06/30/2020         07/31/2020         8/8/2020 

Dimension 1          345                     450                    365

Dimension 2         1,350                   756                    210

 

help?

  

1 ACCEPTED SOLUTION

@sergiod04  Try like

Measure = CALCULATE (lastnonblankvalue(DATE_TABLE[Date],SUM(VALUE))), based on grouping it will choose date. Take month year on axis/row/column

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

4 REPLIES 4
amitchandak
Super User
Super User

@sergiod04 , try like

Measure = CALCULATE (SUM(VALUE), FILTER(DATE_TABLE,DATE_TABLE[Date] = max(DATE_TABLE[Date])))

or
Measure = CALCULATE (SUM(VALUE), FILTER(DATE_TABLE,DATE_TABLE[Date] = lastdate(DATE_TABLE[Date])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , 

 

Thanks for responding. With both the MAX and LASTDATE, it is returning all dates, not just the last day of the month + the most recent one. 😕 

 

end of month was doing the trick of returning only the last day of the month + the last date when i didnt have any date filters applied. the problem is when i apply a date filter that does not land on an end of month. 

 

i appreciate your help. 

@sergiod04  Try like

Measure = CALCULATE (lastnonblankvalue(DATE_TABLE[Date],SUM(VALUE))), based on grouping it will choose date. Take month year on axis/row/column

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This will work! thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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