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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
squarecat
Helper I
Helper I

Max date where another value is not blank

Hello guys,

I'm having trouble creating a measure that shows the max date where the value in another column is not blank

 

squarecat_0-1742390209174.png

For example here it should show the date 1/3/2025.

I have seen a lot of information on how to do the opposite but basically none on this matter, I would appreciate any help.

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @squarecat 

Your description is unclear. You want to find the maximum date where another column has a non-blank value, yet you expect the result to be January 4, where the value in that column is blank. Try either of these:

 

Last Nonblank Date = 
CALCULATE (
    LASTNONBLANK ( MyData[Date], CALCULATE ( SUM ( MyData[Value] ) ) ),
    ALL ( MyData )
)

Earliest Blank = 
CALCULATE (
    MIN ( MyData[Date] ),
    FILTER ( ALL ( MyData ), ISBLANK ( MyData[Value] ) )
)

 

danextian_0-1742391368631.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @squarecat 

Your description is unclear. You want to find the maximum date where another column has a non-blank value, yet you expect the result to be January 4, where the value in that column is blank. Try either of these:

 

Last Nonblank Date = 
CALCULATE (
    LASTNONBLANK ( MyData[Date], CALCULATE ( SUM ( MyData[Value] ) ) ),
    ALL ( MyData )
)

Earliest Blank = 
CALCULATE (
    MIN ( MyData[Date] ),
    FILTER ( ALL ( MyData ), ISBLANK ( MyData[Value] ) )
)

 

danextian_0-1742391368631.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

You are right, apologies. I was looking for the last non blank date meaning 1/3/2025 so the first solution is the one that works for me.

Thank you!

bhanu_gautam
Super User
Super User

@squarecat , Create a measure

MaxDateWithNonBlankValue =
CALCULATE(
MAX('Table'[Date]),
NOT(ISBLANK('Table'[Value]))
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks for taking the time to answer, your solution works! however when trying to use it for making an offset date in my calendar table it doesn't seem to recognize it.

 

Thankfully the solution proposed by the other user seems to work very well, I will attach the calculated column I made so it can help others.

 

Offset month = 
VAR vlast =
    CALCULATE(
    LASTNONBLANK('Table'[Date], CALCULATE(SUM('Table'[Value]))),
    ALL ('Table'))
VAR vResult =
    DATEDIFF (vlast, 'Table'[Date], MONTH ) + 1
RETURN
    vResult

 

squarecat_0-1742392298957.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors