Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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")
        )
    )

 

 

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 !

7 Replies

    • Anonymous's avatar
      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

      • mwegener's avatar
        mwegener
        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.

  • v-lili6-msft's avatar
    v-lili6-msft
    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