Forum Discussion

kartiklal70's avatar
kartiklal70
Frequent Visitor
3 years ago
Solved

Conditional Column Based on Multiple Conditions

Hi All,    I have a CSR (Customer Search Ring) Table that is joined to a Milestones Table.  These two tables are joined on the CSR field. The data in the CSR table is as below:    The data ...
  • v-jianboli-msft's avatar
    3 years ago

    Hi kartiklal70 ,

     

    Please try:

    First Duplicate the Milestones table and delete the relationship between the new table and SR:

    Then use the new table to create a table visual in page 2

    Apply the measure to the visual level filter:

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'SR'[CSR] )
    VAR _b =
        SELECTEDVALUE ( SR[Primary CSR YN] )
    VAR _c =
        SELECTEDVALUE ( SR[Primary CSR] )
    RETURN
        SWITCH (
            TRUE (),
            _b = "Yes"
                && MAX ( 'Milestones2'[CSR] ) = _a, 1,
            _b = "No"
                && (
                    MAX ( 'Milestones2'[CSR] ) = _c
                        && MAX ( 'Milestones2'[Related Record] ) IN { "Site", "SR" }
                ), 1,
            _b = "No"
                && MAX ( 'Milestones2'[CSR] ) = _a, 1
        )

    Final output:

    Best Regards,

    Jianbo Li

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