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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
faridelmjabber
Frequent Visitor

Filter with condition

hi, i'm trying to get a filter that automatically selects me two field,
example, I want if I select the "TOWN HALL" field, the other corresponding field "TOWN HALL - TEMPERATURE" is automatically selected,
some idea? Is it possible to create a filter with a query?

 

Cattura.JPG

5 REPLIES 5
Tahreem24
Super User
Super User

@faridelmjabber ,

I would recommend you to enable "Search" option on your slicer and type "Town Hall" in search bar then select required fields related to Town Hall.

Capture.JPG

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

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

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Yes @Tahreem24 ,

 

Good solution also.

 

If you want to go down the Calculated column route the following DAX should work for you.

 

High Level Selection = IF(CONTAINSSTRING(Table1[Selections],"-"),LEFT(Table1[Selections],FIND("-",Table1[Selections])-2),Table1[Selections])
 
(Obvious disadvantage to this solution is that you will strip out anything after the "-" character. So this will work for all rows in your example,  however will give undesirable results if your row contains 2 or more instances of the "-")
 
🙂 sduffy

thanks for the tip but it can't work for me, because they can be given for example:
TOWN HALL 1
TOWN HALL 2
TOWN HALL - TEMPERATURE

If I select 1 I must restore 1 + temeratua, and if I select two I must take 2 + temperatures

Anonymous
Not applicable

HI @faridelmjabber 

 

I would consider a new calculated Column that incorporates a high level common factor between the  'xxx' & 'xxx - Temparatura'.  Then you would slice/filter based on the high level column.

 

Let me know if you are unsure.

 

Regards, sduffy

it can't work for me, because the table is always updating with new values

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.