Forum Discussion
I need help to optimize Dax
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 a later stage.
Accepted =
My problem is that each row looks though each other row to find the right date. This means that the memory required to update my report grows exponential as I get more rows and that is obviously unsustainable.
Does any of your bright folks have an idea to how I can get around this issue?
All help is greatly appreciated.
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])
2 Replies
- amitchandak
Super User
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])- ThomasWeppler
Impactful Individual
Thanks amitchandak It worked perfectly.
You are a Power BI God.