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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
marama
Helper I
Helper I

Filter Table based on slicer value and multiple conditions

Hi.

I have a table with flights, source and destination cities.

In  slicer, I have a list of cities.

I need a visual table to list all entries where selected city is either a source or a destination.

If my understanding is right, I cannot do a relationship model but I need to filter the visual based on some DAX logic, right? What would the syntax be? Or is there some easier solution?

Thank you

1 ACCEPTED SOLUTION

Hi, @marama 

You can create a measure  to filter table visual:

Try measure as below:

filter =
VAR a =
    IF (
        SELECTEDVALUE ( 'Table'[destination] )
            IN VALUES ( City[city] )
                || SELECTEDVALUE ( 'Table'[source] ) IN VALUES ( City[city] ),
        1,
        0
    )
RETURN
    IF ( ISFILTERED ( City[city] ), a, a )

Then apply it to visual filter pane.

25.png

Please let me know if I misunderstood.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@marama , Youcan join city with both source and destination, one join will inactive that you can activate using userelationship 

then measure like below, assume source  join is active

 

count(Table[source ]) + calculate(count(Table[destination]), userelationship  (city[city],Table[destination]) )

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, but join turned out to be too slow in my case (I have more then 100K records)

Hi, @marama 

You can create a measure  to filter table visual:

Try measure as below:

filter =
VAR a =
    IF (
        SELECTEDVALUE ( 'Table'[destination] )
            IN VALUES ( City[city] )
                || SELECTEDVALUE ( 'Table'[source] ) IN VALUES ( City[city] ),
        1,
        0
    )
RETURN
    IF ( ISFILTERED ( City[city] ), a, a )

Then apply it to visual filter pane.

25.png

Please let me know if I misunderstood.

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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