Forum Discussion

ThomasWeppler's avatar
ThomasWeppler
Icon for Impactful Individual rankImpactful Individual
3 years ago
Solved

I need help to optimize Dax

Hi power BI community I have a tabel that looks at diffrent states a task can come through todostaehistory For each row I want to see if the same task todostaehistory [todoid] has been accepted at ...
  • amitchandak's avatar
    3 years ago

    ThomasWeppler , try like

     

    new column =
    Maxx(filter(todostatehistory, todostatehistory[todoid] = earlier(todostatehistory[todoid] ) && Todostatehistory[date] > earlier(Todostatehistory[date]) ), Todostatehistory[date])

     

    Or break into two column
    or create a rank first - new columns
    rank = Rankx(filter(todostatehistory, todostatehistory[todoid] = earlier(todostatehistory[todoid] )), Todostatehistory[date],,asc,dense)


    new column date=
    Maxx(filter(todostatehistory, todostatehistory[todoid] = earlier(todostatehistory[todoid] ) && Todostatehistory[rank] > earlier(Todostatehistory[rank])+1 ), Todostatehistory[date])