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.
Hello,
This might be a simple answer, but i've been struggling with this. I have 2 new columns in a table in Power BI. There are specific calculations for each of those columns. now that I have those working, I just need to create a 3rd column that subtracts the value between the two. For example, The 2 columns I have are named FC, RP, and they each hold the value 2, 4. So I just need to subtract the 2 in a 3rd column, but I keep running into a "circular dependency was detected" issue. I've tried removing filters and a few other things I found online, but nothing's working for me. It seems like it should just be a simple calculation, or maybe i'm overthinking this? Any help on this would be great.
Note: The other 2 calculated columns don't reference any other table, they calculated from values within the same table.
Below are the 2 custom columns I created.
RP = CALCULATE(SUM(TABLE[QTY])-CALCULATE(IF(SUM(TABLE[QTY])<AVERAGE(TABLE[CASE_CAPACITY]),0,IF(AVERAGE(TABLE[CASE_CAPACITY])=0,0,IF(OR(CONTAINS(TABLE,TABLE[VAS],"CASE PACK VAS"),CONTAINS(TABLE,TABLE[VAS],"GOH + CASE PACK VAS")),0,ROUNDDOWN((AVERAGE(TABLE[CASE_CAPACITY])/SUM(TABLE[QTY]))*SUM(TABLE[QTY]),0))))),REMOVEFILTERS(TABLE[FC])
)
FC = CALCULATE(IF(SUM(TABLE[QTY])<AVERAGE(TABLE[CASE_CAPACITY]),0,IF(AVERAGE(TABLE[CASE_CAPACITY])=0,0,IF(OR(CONTAINS(TABLE,TABLE[VAS],"CASE PACK VAS"),CONTAINS(TABLE,TABLE[VAS],"GOH + CASE PACK VAS")),0,ROUNDDOWN((AVERAGE(TABLE[CASE_CAPACITY])/SUM(TABLE[QTY]))*SUM(TABLE[QTY]),0))))
)
Hi @Anonymous ,
A circular dependency is detected whenever two objects reference each other, in such a way that Power BI cannot process the objects.
Refer to:
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've read through this article, and I think I understand what a circular dependency is, I just don't see how it's being applied here. All I'm doing is subtracting between the two columns I created in DAX. When looking at the code for those two columns, they're not referring each other, they both refer to other columns within the tables. Would it help if I were to put the code of those 2 columns here?
@Anonymous If you have a truly recursive formula then there may not be a solution. DAX hates recursion. Previous Value (“Recursion”) in DAX – Greg Deckler
No recursion formulas at all.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |