Reply
avatar user
Anonymous
Not applicable

Circular dependency

Hi guys,

 

I have a circular dependency that I can not detecte

 

If I understood well the definition. A  circular dependency is when a measure/column A uses another B to compute and B need A to have a result. 

 

Here is my code

 

High Risk = 
//for each URL, if the number of High Flaws is not equal to the number of High Flaws corrected, the risk of the URL is High
IF(
    (CALCULATE(COUNTROWS(SAFE_FINDING))) = 
    (CALCULATE(COUNTROWS(SAFE_FINDING),SAFE_FINDING[STATUS]="closed"))
    ,0,1
)

 

 

 

Risk Site Level = 

IF(
    vWebSites[% Remediation]=1,"Not At Risk",
    IF(vWebSites[Critical Risk]=1,"Critical",
        IF(vWebSites[High Risk]=1,"High",
            "Not At Risk")
        )
    )

 

 

Capture.PNG

High Risk doesn't depend on Risk Site Level so I don't understand why do I have this problem

 

A strange thing is this way of calcul worked until I change the tab A to SAFE_FINDING in the formulas. 

The Tab A is directly linked to vWebsite and there is 2 tabs between vWebsite and SAFE_FIDING 

 

Thank you guys !

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

look at this.

 

"Nevertheless, by using CALCULATE, we are asking to transform the current row context into a filter context and this modifies the dependency list."

https://www.sqlbi.com/articles/understanding-circular-dependencies/

 

"Risk Site Level" is therefore part of the filter context of "High Risk".

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

7 REPLIES 7
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

If you still have the problem, please share your sample pbix file, we will show you the right formula.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

look at this.

 

"Nevertheless, by using CALCULATE, we are asking to transform the current row context into a filter context and this modifies the dependency list."

https://www.sqlbi.com/articles/understanding-circular-dependencies/

 

"Risk Site Level" is therefore part of the filter context of "High Risk".

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


avatar user
Anonymous
Not applicable

@mwegener 

thank you for the article that I read and appreciated a lot. I understood where is the problem
But I don't know why the measures had been working until I changed the table of the calcul of the measures(High Risk).

 

The way of computation and the depency remains the same.

 

To reduce the list of depency , I tried to use ALLEXCEPT as adviced in the article:

 

 

High Risk = 

IF(
    CALCULATE(COUNTROWS('SAFE_FINDING'),ALLEXCEPT(vWebSites,vWebSites[name])) = 
    CALCULATE(COUNTROWS('SAFE_FINDING'),LOWER('SAFE_FINDING'[STATUS])="closed",ALLEXCEPT(vWebSites,vWebSites[name]))
    ,0,1
)

 

I reduced the list of depency to only 1 which is the 'vWebSites'[name] thus the measure 'Risk Site Level' is not anymore part of filter context of High Risk. But nothing change 😞 Have I done something wrong ?

 

 

 

@v-lili6-msft  Hello, thank you for the answer. I'm not able to send you the PIBX which must be privated

hi  @Anonymous 

If possible, could you please use some dummy data to create a sample pbix file for us have a test, that will be a great help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
avatar user
Anonymous
Not applicable

Hi @v-lili6-msft  @mwegener 

 

My data model is still changing so I should adapt my works to it. Currently, I changed my way of computation and it's working.

Thank you very much for your time !

 

Have a nice weekend !

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

Please mark a post as solution, this will also help others.
Please give Kudos for support.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

can you share a screenshot of the Model view?

I have not yet been able to successfully deal with this topic.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)