The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
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 ) )
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!
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
10 | |
10 | |
10 | |
9 |