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
Cheywork91
Frequent Visitor

Help! Want to filter a table if the slicer selection is in either one of 2 columns.

Hey,

So for data structure, I have two tables with similar info, but they are tied together by posn number.  The end goal is that the slicer will filter the table if the selection is in either of the two columns in the table. 

I tried to make a dimension table using 'summarize' to create the slicer, pulling all the personal trades from one table, and all the positional trades from another table. 

dim Trades =
DISTINCT(
    UNION(SUMMARIZE('All Pers', 'All Pers'[Trade Name]),
        SUMMARIZE('POSN Trade', 'POSN Trade'[Trade Name])    
    )
)


It doesn't seem to be working. When I use the slicer, it's only pulling up lines that have the selected Trade name, but it's not pulling up the people that have the pers trade, in posns with a diff trade.

Any ideas?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Cheywork91 
Make 'dim Trades' a disconnetced table (delete the relationships between the dim table and the other two tables). In other words, the three tables model will be left without any relationship.

Place the following measure in the filter pane of the visual, select "is not blank" and apply the filter. I would expect the slicer from  'dim Trades' will filter the visual based on OR condition rather than AND.

FilterMeasure =
VAR SelectedTrades =
    VALUES ( 'dim Trades'[Trade] )
VAR Pers =
    COUNTROWS ( FILTER ( 'All Pers', 'All Pers'[Trade Name] IN SelectedTrades ) )
VAR Posn =
    COUNTROWS (
        FILTER ( 'POSN Trade', 'POSN Trade'[Trade Name] IN SelectedTrades )
    )
RETURN
    Pers + Posn

 

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Cheywork91 
Make 'dim Trades' a disconnetced table (delete the relationships between the dim table and the other two tables). In other words, the three tables model will be left without any relationship.

Place the following measure in the filter pane of the visual, select "is not blank" and apply the filter. I would expect the slicer from  'dim Trades' will filter the visual based on OR condition rather than AND.

FilterMeasure =
VAR SelectedTrades =
    VALUES ( 'dim Trades'[Trade] )
VAR Pers =
    COUNTROWS ( FILTER ( 'All Pers', 'All Pers'[Trade Name] IN SelectedTrades ) )
VAR Posn =
    COUNTROWS (
        FILTER ( 'POSN Trade', 'POSN Trade'[Trade Name] IN SelectedTrades )
    )
RETURN
    Pers + Posn

 

amitchandak
Super User
Super User

@Cheywork91 , You joined the dimension back to both tables ?

Both table will be filtered by common dim

 

refer, if need

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

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

Yes, but the problem is that it's not finding all the people with the selected trade, when their posn trade is something different. 

When Y on the slicer is selected, I want it to show me the lines where :
Pers is R trade, but their posn is Y trade.
Pers is Y trade, posn Y trade.
Pers is Y trade, posn is B trade. 

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.