Forum Discussion

baneworth's avatar
baneworth
Helper III
2 years ago
Solved

Circular dependancy error

Hi,

 

i read some threads on this topic before because it seems to be common, but even with all the solutions i saw i couldnt figure mine out.

So i will try to explain my issue as best as i can and hopefully someone can help me out.

 

In my table i have Serial Numbers and Dates from Quality inspections, one Serial Number can have several Inspection Dates (refer to image)

 

This is an example of 1 Serial Number with Inspection Dates

 

Now i want to create a calculated column in this table to show me the MIN Date for all Serial Numbers -> i want to sort Serial Number by Inspection Dates and therefore i need to create the Mindate column to avoid different dates for the same serial number.

 

Formula for calculated column

 

This formula gives me back the circular dependancy, even though i read that ALLEXCEPT should avoid this.

Help appreciated.

 

Best regards

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, baneworth 

    I have tested your DAX formula using the created column you provided and based on the fact that one serial number corresponds to multiple dates as you mentioned. The test resulted in no circular dependencies and got the target column you wanted. Here's a screenshot of my test:

    DAX formula:

    QCBS Done = CALCULATE(MIN(Fact_QCBS[created]),ALLEXCEPT(Fact_QCBS,Fact_QCBS[Serial number]))

    The results are as follows:

    There are many reasons why circular dependencies arise, and here are some of the possible reasons I've compiled:

    1. The value of one column depends on the value of another column, which in turn depends on the value of the first column. In this case, the DAX engine cannot determine which column should be calculated first, and therefore reports an error.
    2. Table A depends on Table B, which in turn depends on Table A. Then there is a circular dependency.
    3. If other columns in your table depend on the created column or the serial number column, a circular dependency occurs.

    Can you provide me with a sample PBIX where this problem occurs? I'll try to help you as soon as I can.

     

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, baneworth 

    I have tested your DAX formula using the created column you provided and based on the fact that one serial number corresponds to multiple dates as you mentioned. The test resulted in no circular dependencies and got the target column you wanted. Here's a screenshot of my test:

    DAX formula:

    QCBS Done = CALCULATE(MIN(Fact_QCBS[created]),ALLEXCEPT(Fact_QCBS,Fact_QCBS[Serial number]))

    The results are as follows:

    There are many reasons why circular dependencies arise, and here are some of the possible reasons I've compiled:

    1. The value of one column depends on the value of another column, which in turn depends on the value of the first column. In this case, the DAX engine cannot determine which column should be calculated first, and therefore reports an error.
    2. Table A depends on Table B, which in turn depends on Table A. Then there is a circular dependency.
    3. If other columns in your table depend on the created column or the serial number column, a circular dependency occurs.

    Can you provide me with a sample PBIX where this problem occurs? I'll try to help you as soon as I can.

     

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • baneworth's avatar
      baneworth
      Helper III

      Anonymous Thank you for your effort, the issue resolved itself after i made a change to the table itself (coming from sharepoint).

       

      BR