Forum Discussion
Measure taking forever to execute
you could try changing the filters to calculatetable - Curbal has done a video about it here .
DAX Fridays Battle #188: FILTER vs CALCULATETABLE - Avoid using FILTER as a filter argument - YouTube
Also try and compute the tables before performing the DAX sometime when I create summarizecolumn tables then perform the dax ontop it turns out being quicker! good luck!
Magpie_Rob
Thanks for your reply
I watched the video, and changed my measure to use CALCULATETABLE() instead of FILTER().
Its greate to know about this itterative functionality of FILTER(), but in my case, it didn't help.
I have to itterate through every row, and then say where the next ID is according to two conditions.
This is my simplified measure. I backed up and started with only calculating the next ID in a measure, which then I would use in my further calculations.
Before:
Next_id =
VAR _id = SELECTEDVALUE(Table[id])
VAR _level = SELECTEDVALUE(Table[Level#])
VAR _nextId = CALCULATE(MIN(Table[id]), FILTER(ALL(Table), Table[id] > _id && Table[Level#] <= _level))
RETURN _nextId
After:
Next_id =
VAR _id = SELECTEDVALUE(Table[id])
VAR _level = SELECTEDVALUE(Table[Level#])
VAR _nextId = CALCULATE(MIN(Table[id]), CALCULATETABLE(Table, Table[id] > _id, Table[Level#] <= _level))
RETURN _nextId