Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
10 |
User | Count |
---|---|
19 | |
16 | |
14 | |
11 | |
9 |