Forum Discussion

vojtechsima's avatar
vojtechsima
Icon for Super User rankSuper User
1 year ago
Solved

Optimize 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...
  • gmsamborn's avatar
    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
        _Result

    cleaner_dax_with_iterators_json - mine.pbix

     

    Please let me know if you have any comments/questions.