Forum Discussion

o59393's avatar
o59393
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Calculated columns not working due to circular dependency

Hi   I am doing two calculated columns and I am getting a circular dependency error in one of them.   The 'Capacity Real' column is basically a multiplication of =   [BPM Conversion Real] * [M...
  • mahoneypat's avatar
    mahoneypat
    4 years ago

    This column expression avoids the error, but I definitely encourage you to fix your model.  Simple model, simple dax.

     

    Capacity Goal =
    VAR bpmgoal =
        CALCULATE (
            [BPM Conversion Goal],
            REMOVEFILTERS ( 'SKU by line - Official'[Capacity Real] )
        )
    VAR mix =
        CALCULATE (
            [Mix by product],
            REMOVEFILTERS ( 'SKU by line - Official'[Capacity Real] )
        )
    VAR result =
        IF (
            'SKU by line - Official'[Month] = 1,
            (
                bpmgoal * mix
                    RELATED ( 'Hours by line - Official'[Max available time January (hours) [Calendar days - Non working days) * # of max shifts possible * hours per **bleep**] )
                    RELATED ( 'Hours by line - Official'[Total hours to discount (CIP and Mold Changes) - January] )
            ) * 60,
            IF (
                'SKU by line - Official'[Month] = 2,
                (
                    bpmgoal * mix
                        RELATED ( 'Hours by line - Official'[Max available time February (hours) [Calendar days - Non working days) * # of max shifts possible * hours per **bleep**] )
                        RELATED ( 'Hours by line - Official'[Total hours to discount (CIP and Mold Changes) - February] )
                ) * 60,
                0
            )
        )
    RETURN
        result

     

    Pat