March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all
I am getting a circular dependency error, which I have no clue how to fix because no major detail is given.
I will share the 3 dax I use:
1)
Production hours (bottler demand) =
SUMX (
SUMMARIZE (
'SKU by line - Official',
'Hours by line - Official'[Manufacturing plant],
'Hours by line - Official'[Manufacturing line],
'SKU by line - Official'[Merged Product],
"Production", SUM ('SKU by line - Official'[Demand by bottler]),
"UC per hour", [BPM Conversion Real]),
DIVIDE(
[Production],
[UC per hour])
)
2)
Mix by Line Bottler (Hours) =
DIVIDE(
CALCULATE(
SUMX(
'SKU by line - Official',
'SKU by line - Official'[Production hours (bottler demand)]
)
)
,
CALCULATE(
SUMX(
'SKU by line - Official',
'SKU by line - Official'[Production hours (bottler demand)]),
ALLEXCEPT(
'SKU by line - Official',
'SKU by line - Official'[Manufacturing plant of production],
'SKU by line - Official'[Manufacturing line],
'SKU by line - Official'[Date]
)
)
)
3)
3 - Capacity Bottler (Mix with Hours) =
Var mix =
CALCULATE(
'SKU by line - Official'[Mix by Line Bottler (Hours)],
REMOVEFILTERS(
'SKU by line - Official'[Capacity Bottler],
'SKU by line - Official'[Calculated Column Capacity NSR (Mix UC)],
'SKU by line - Official'[2 - Capacity NSR Hours (Mix Hours)])
)
Var result =
mix
* RELATED(
'Hours by line - Official'[Available Production Hours]
)
return result
The error shows as:
Any idea how to fix this?
Thanks.
Hi, @o59393
It is hard to determine what the cyclic dependency error is based on the DAX you provided, it needs to be combined with your data to determine that, you can either share the pbix file without sensitive data or break the chain by rewriting one or more of the metrics. One way is to use variables to store intermediate results and use them in subsequent calculations. Another way is to use the function to create a temporary table containing the results of one metric and then use that table when calculating another metric. Feel free to help you.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @o59393
Of course, I was able to open the file, and after troubleshooting, I can only determine now that it's related to this code below, which may take more time to test.
Best Regards,
Yang
Community Support Team
Hi, could you also share the file with me, or perhaps add a link in the comments for anyone interested to download? I'm keen on helping address the issues.
check theses three measures, it might contain "All" / "values" in the syntax, replace with distinct or allnonblank
can you show us the formula of the three measures, it is hard to tell if they are causing errors.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
87 | |
85 | |
76 | |
49 |
User | Count |
---|---|
163 | |
148 | |
103 | |
74 | |
55 |