Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
All,
Fairly new to calculation groups and want to know if the following is possible.
My calculation group has 2 calculated items A and B. I want to get a percentage, and add a third item C = DIVIDE (A, B). My question is if there is a way to reference the calculation items in the expression for C or do I need to repeat the expression in C, as in DIVIDE ( A expr, B expr).
Reason I ask is for maintainability, if I change A for example, I would need to change the A expression in C, otherwise I would be off. Also, the expression for my B item is quite lengthy and want to keep it easier to read.
Thanks
Be carefull of using sideways recursion as it can cause a number of problems. Instead write the full expression again.
But answering you question this can be achived though
DIVIDE(
CALCULATE(SELECTEDMEASURE(), 'CalcGroup'[CalcColumn] = "Calc item A"),
CALCULATE(SELECTEDMEASURE(), 'CalcGroup'[CalcColumn] = "Calc item B")
)
HI, Did you manage to acheive this? I'm trying to do the same....
Hi @mcolb88 ,
Use Variables.
https://www.sqlbi.com/articles/variables-in-dax/
https://docs.microsoft.com/en-us/power-bi/guidance/dax-variables
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
I undestand the use of variables, I don't want to repeat the expression in the calculation of item C, I simply want to reference another calculated item. Is that possible?
Thanks
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
11 | |
10 | |
7 | |
6 |
User | Count |
---|---|
13 | |
12 | |
12 | |
8 | |
8 |