Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
mcantos
Helper I
Helper I

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):

 

mcantos_1-1737029713969.png

but I don't know how to apply additional filters to validate: If status="Declined" then take the "Declined Date" from the current month to get this

 

mcantos_2-1737029756072.png

 

It seems the alternative is to create a new Calculated table but I don't have that option. Are there any other ways to do it? 

 

Thank you!

 

1 ACCEPTED SOLUTION

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)

vyiruanmsft_0-1737082953227.png

Best Regards

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

View solution in original post

4 REPLIES 4
mcantos
Helper I
Helper I

Thank you so much @v-yiruan-msft ,

That's exactly what I needed. 

 

Uzi2019
Super User
Super User

Hi @mcantos 

 

Try this calculated column

New Date =
var A= DATE(YEAR(TODAY()),MONTH(TODAY()),DAY('Product Status'[Declined Date]))
var b= IF('Product Status'[Status]="Declined",A,BLANK())
RETURN b
 
and check the screenshot below.
Uzi2019_0-1737031138918.png

 

In the screenshot all the status which value are decline have replaced their month and year value by keeping the Day value.

 

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

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: 

mcantos_0-1737042589173.png

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)

vyiruanmsft_0-1737082953227.png

Best Regards

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.