Forum Discussion
Aplying conditional filters in table
- Anonymous1 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
Thank you Uzi2019 for your replay but I don't want to change the dates and sorry because I think I was not clear enough
I want to keep the dates and apply a new filter that allows me to keep the products with "Active" status and products with "Declined" status and the declined date is in the current month. So, in the end, after applying the filters I must have as result these two rows:
Thank you again
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