Forum Discussion
CallumJ
4 years agoFrequent Visitor
If Else Date Question
Hi All, Ratting around in my brain to see how this would work, here is my data: No. Stage Date 1 P 10/05/2022 1 F 12/08/2022 1 A 2 P 2 F 15/06/2022 2 A 22/0...
- 4 years ago
CallumJ Create a Column like this:
Column =VAR A_ = CALCULATE(MAX(StageTable[Date]),StageTable[Stage]="A",ALLEXCEPT(StageTable,StageTable[No.]))VAR P_ = CALCULATE(MAX(StageTable[Date]),StageTable[Stage]="P",ALLEXCEPT(StageTable,StageTable[No.]))VAR F_ = CALCULATE(MAX(StageTable[Date]),StageTable[Stage]="F",ALLEXCEPT(StageTable,StageTable[No.]))RETURN SWITCH(TRUE(),A_=BLANK(),F_,P_=BLANK(),A_,F_=BLANK(),A_,A_)
amitchandak
4 years agoSuper User
CallumJ , Based on what I got
A new calculated table in dax =
Summarize(Filter(Table, not(isblank(Table[Date])) , Table[No], "Date", Max(Table[Date]) )
- CallumJ4 years agoFrequent Visitor
Hi Amitchandak,
Appreciate your response, however I need an order of preference for the Dates, i.e. if A ISNOTNULL() then use the A Date, else if F ISNOTNULL() then use F Date, else if P ISNOTNULL() then use 'Null'.
The distinction is that it doesn't matter what date is the Max/Min, I need to set up an order of prefence.