Forum Discussion

mcantos's avatar
mcantos
Icon for Helper II rankHelper II
1 year ago
Solved

Aplying conditional filters in table

Hi community,    I have this table I created  Power Bi desktop, which already contains some filters such as stage (Stage 1 or Stage 2 or Stage 3), Status (Active and Declined):   but I don'...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi mcantos ,

    I created a sample pbix file(see the attachment), please check if that is what you want.

    1. Create a measure as below

    Flag = 
    VAR _product =
        SELECTEDVALUE ( 'Table'[Product] )
    VAR _tab =
        CALCULATETABLE (
            VALUES ( 'Table'[Product] ),
            FILTER (
                'Table',
                'Table'[Status] = "Active"
                    || (
                        'Table'[Status] = "Declined"
                            && YEAR ( 'Table'[Declined Date] ) = YEAR ( TODAY () )
                    )
            )
        )
    RETURN
        IF ( _product IN _tab, 1, 0 )

    2. Create a table visual and apply a visual-level filter with the condition (Flag is 1)

    Best Regards