Forum Discussion

tomas12344's avatar
tomas12344
Helper III
4 years ago
Solved

Calculation group with PBI and Tabular editor - reference calculation item

HI All have created some calculation groups in PBI with Tabular editor. I want to create some calculation, with this technique, to calculated some differencies, percentages,.... of measures/values, ...
  • johnt75's avatar
    4 years ago

    You can reference the previously defined items, you can even have multiple calculation groups as long as you set the precedence properly.

    To refer to a particular calculation item you can use TREATAS, e.g.

    Measure Z =
    var resultX = CALCULATE( [Base measure], TREATAS( { "X" }, 'Calculation Group'[Calculation Item]) )
    var resultY = CALCULATE( [Base measure], TREATAS( { "Y" }, 'Calculation Group'[Calculation Item]) )
    return DIVIDE( resultX, resultY )