Forum Discussion
vojtechsima
Super User
1 year agoOptimize double iteration measure in DAX
Hello,
I'd like to know how I can optimize this measure. The goal is to eliminate double iteration while keeping the logic.
efficency iterative =
AVERAGEX(
VALUES(dim_date[date]),
A...
- 1 year ago
HI vojtechsima
I'm nnot sure i really understood the question.
Would a measure like this help?
MyEfficience = VAR _Table = SUMMARIZE( 'fact', 'fact'[dateKey], 'fact'[departmentKey], "__Eff", CALCULATE( [efficiency] ) ) VAR _Result = AVERAGEX( _Table, [__Eff] ) RETURN _Resultcleaner_dax_with_iterators_json - mine.pbix
Please let me know if you have any comments/questions.
gmsamborn
Super User
1 year agoHI vojtechsima
I'm nnot sure i really understood the question.
Would a measure like this help?
MyEfficience =
VAR _Table =
SUMMARIZE(
'fact',
'fact'[dateKey],
'fact'[departmentKey],
"__Eff", CALCULATE( [efficiency] )
)
VAR _Result =
AVERAGEX(
_Table,
[__Eff]
)
RETURN
_Result
cleaner_dax_with_iterators_json - mine.pbix
Please let me know if you have any comments/questions.
- vojtechsima1 year ago
Super User
gmsamborn thanks, my question was if there's a more efficient way to write the double iteration measure.
Your solution works, the speed seems similar, I'll test it in my original solution.
Thanks regardless.