Forum Discussion

amit_msmba's avatar
amit_msmba
New Member
3 years ago
Solved

Filter a table based on multiple conditions

Hi Friends,   I need help writing this measure. Here is a sample data. Plan      Year    Amt Plan 1   2019   30 Plan 1   2020   40 Plan 1   2021   15 Plan 2   2015   20 Plan 2   2018   20 Pl...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi amit_msmba ,

    I created a sample pbix file(see the attachment), please check if that is what you want. You can create the measures below to get it and apply a visual-level filter on your table visual with the condition(Flag is 1😞

    Sum of Amt = SUM('Table'[Amt])
    Flag = 
    VAR _plan =
        SELECTEDVALUE ( 'Table'[Plan] )
    VAR _tab =
        CALCULATETABLE (
            VALUES ( 'Table'[Plan] ),
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Plan] = _plan && [Sum of Amt] > 35 )
        )
    RETURN
        IF ( _plan IN _tab, 1, 0 )

    Best Regards