cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Prodigy

Circular dependency - Very hard error to identfy

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.

10 REPLIES 10
Community Support

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!

Post Prodigy

Did the file open?

Thanks.

Community Support

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

Post Prodigy

Let me know when you have news.

Regards.

Post Prodigy

Do you have any news?

thanks

Helper II

Post Prodigy

Thanks @v-yaningy-msft , sent you a msg.

Regards.

Helper II

check theses three measures, it might contain "All" / "values" in the syntax,  replace with distinct or allnonblank

Post Prodigy

Hi @CupidC  not sure I understood

where should I use the distinct part?

thanks

Helper II

can  you show us the formula of the three measures, it is hard to tell if they are causing errors.