Forum Discussion

hebe's avatar
hebe
Frequent Visitor
2 years ago
Solved

Two Calculated columns with RELATEDTABLE gives Circular Dependency

I need to find all persons that have a certain value in another table but not another value.   For instance a person that has a valid licence and also a cancellation of that licence and they are st...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi hebe ,

    You can try the following DAX to add calculated columns.

    Issued = 
    VAR _SEL= CALCULATE (
            COUNTROWS ( 'Status' ),
            ALLEXCEPT(Person,Person[Id]),
            'Status'[Status] = "Issued"
        )
    RETURN IF ( _SEL > 0, "Yes", "No" )

     

    Cancelled = 
    VAR _SEL= CALCULATE (
            COUNTROWS ( 'Status' ),
            ALLEXCEPT(Person,Person[Id]),
            'Status'[Status] = "Cancelled"
        )
    RETURN IF ( _SEL > 0, "Yes", "No" )


    Please see the attached pbix for reference.

    Best Regards,

    Dengliang Li

     

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