Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
tomas12344
Helper III
Helper III

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, that are already defined in same or other calculation group.

 

The question is, if it is posible, to use/reference another calculation item, previosly defined. For example, if i have created a calculation group A, and within it a calculation item X and Y, and want to calculate a difference and percentage of X and Y. Do i have to write the same expresion for calculation item Z (which should be eqaul to X-Y), or can i reference somehow the previously defined items X and Y?

thank you

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

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 )

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

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 )

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.