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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mircea
Helper I
Helper I

Calculate maximum date independent of filters

Hello,

 

I am new to DAX calculations.

I know that I can calculate the maximum [Date1] independent of filters like this:

[MAX Date] =
 CALCULATE(
    MAX( MyTable[Date1] ),
    ALL( 'MyTable' )
)

My problem is that I have 4 different date columns [Date1], [Date2], [Date3], [Date4] and I want to return the maximum date among them. Note that any filter must be ignored.

 

Please advise.

Regards

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Without unpivoting your date column, I can't think of a way around calculating each separately and then finding the maximum among the maximums.

 

MAX Date =
VAR Max1 = CALCULATE ( MAX ( MyTable[Date1] ), ALL ( 'MyTable' ) )
VAR Max2 = CALCULATE ( MAX ( MyTable[Date2] ), ALL ( 'MyTable' ) )
VAR Max3 = CALCULATE ( MAX ( MyTable[Date3] ), ALL ( 'MyTable' ) )
VAR Max4 = CALCULATE ( MAX ( MyTable[Date4] ), ALL ( 'MyTable' ) )
RETURN
    MAX ( MAX ( Max1, Max2 ), MAX ( Max3, Max4 ) )

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

Without unpivoting your date column, I can't think of a way around calculating each separately and then finding the maximum among the maximums.

 

MAX Date =
VAR Max1 = CALCULATE ( MAX ( MyTable[Date1] ), ALL ( 'MyTable' ) )
VAR Max2 = CALCULATE ( MAX ( MyTable[Date2] ), ALL ( 'MyTable' ) )
VAR Max3 = CALCULATE ( MAX ( MyTable[Date3] ), ALL ( 'MyTable' ) )
VAR Max4 = CALCULATE ( MAX ( MyTable[Date4] ), ALL ( 'MyTable' ) )
RETURN
    MAX ( MAX ( Max1, Max2 ), MAX ( Max3, Max4 ) )

Thank you Alexis for your quick help!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.