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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to Apply 2 filters on a single view with OR condition as a selection factor?

Hi,

 

I got a requirement from the user that they have 2 filters i.e, Part Number & Part Family

it should act as OR condition i.e, i want results of all selected filters from both the table .

 

can any one please help me to get this view?

 

Thanks,

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a masure , and here don't need flag measure.

Measure =
CALCULATE (
    COUNT ( 'DISCOPrime CustomerRiskFactorsSnapshot'[Part Family] ),
    FILTER (
        'DISCOPrime CustomerRiskFactorsSnapshot',
        [Part Family]
            IN ALLSELECTED ( 'Filter 2'[Filter - Part Family] )
                || [Part Number] IN ALLSELECTED ( 'Filter 1'[Filter - Part Number] )))

Then change the cout of Part Family to measure.

vyalanwumsft_0-1637574352489.png

 

The final output is shown below:

vyalanwumsft_1-1637574400506.png

Best Regards,
Community Support Team_ Yalan Wu
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

13 REPLIES 13
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a masure , and here don't need flag measure.

Measure =
CALCULATE (
    COUNT ( 'DISCOPrime CustomerRiskFactorsSnapshot'[Part Family] ),
    FILTER (
        'DISCOPrime CustomerRiskFactorsSnapshot',
        [Part Family]
            IN ALLSELECTED ( 'Filter 2'[Filter - Part Family] )
                || [Part Number] IN ALLSELECTED ( 'Filter 1'[Filter - Part Number] )))

Then change the cout of Part Family to measure.

vyalanwumsft_0-1637574352489.png

 

The final output is shown below:

vyalanwumsft_1-1637574400506.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks a lot for your patience and help! Its really helpful.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Sorry for the late reply,

you have to upload your file to a cloud storage (like OneDrive, Dropbox, Google Drive or Wetransfer for example) and paste the link to that storage location in the post.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

Best Regards,
Community Support Team_ Yalan Wu

Anonymous
Not applicable

 

Please have a look, I have shared in google drive

 

https://drive.google.com/file/d/1tNa3DdxveN6LQ7dcXVuVR2r7P1W_ja7T/view?usp=sharing

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

[Part Number] is from another table? I tested it updated, In my simple ,it works fine. so I'm not quite sure why, but maybe you could change my Simple to make it more similar to your model?

vyalanwumsft_0-1637306519770.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Part Number is from same table, I don know why it is not working for my data.

 

I would like to share my workbook, is there any way to attach?

Anonymous
Not applicable

 

 

Highlighted data are missing?

 

Manasa_Rao_2-1637323894244.png

 

Anonymous
Not applicable

I'm selecting irrrelevant combination of part number & family number.

 

Manasa_Rao_0-1637323137365.png

 

your chart working as AND operation, i dont wanna work like that i wanted to show the results of all selected filter from both.

 

 

Anonymous
Not applicable

How to attach power bi file here?

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

This can be done by creating an unrelated table as a filter field and then creating flag measures to allow them to interact.

1.create a table1 as filter 1.

Filter2 = VALUES('Table'[SEQ])

2.create a table2 as filter 2.

Filter2 = VALUES('Table'[SEQ])

3.then create a flag measure.

Flag = IF(MAX('Table'[SEQ]) in ALLSELECTED('Filter2'[Filter-SEQ]) ||MAX('Table'[Oy]) in ALLSELECTED('Fliter1'[Filter-Oy]),1,0)

Apply it into filter ,

vyalanwumsft_0-1637289987981.png

 

The final output is shown below:

If i select '2021-10' and 'B', it will show all rows relvant with it .

vyalanwumsft_1-1637290029294.png

 

If you use slicer ,only create one unrelated table  then cancel the interaction between slicers.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for wonderfull solution.

 

But, I haven't used Part family Number anywhere in the chart but used as filter

 bcz of this i'm getting blank when i select the filters. do you have any solution?

 

Xaxis :

 

XAxisRiskScore = IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=0 && 'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=10, "0-10",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=11 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=20, "11-20",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=21 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=30, "21-30",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=31 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=40, "31-40",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=41 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=50, "41-50",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=51 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=60, "51-60",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=61 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=70, "61-70",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=71 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=80, "71-80",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=81 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=90, "81-90",
IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=91 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=100, "91-100"))))))))))
 
 
Y Axis
Count of Part Number
 
Legend
Risk Type = IF('DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>=0 &&'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=30,"LOW",
IF( 'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>30 && 'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=60,"MEDIUM",
IF( 'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]>60 && 'DISCOPrime CustomerRiskFactorsSnapshot'[RiskScore]<=100,"HIGH")))

 

List of Filters Required

 

Manasa_Rao_5-1637299245673.png

 

 

Manasa_Rao_0-1637298177109.png

Blank view when i choose the filters from both

 

Manasa_Rao_4-1637298607513.png

 

Please feel to ask any question.

 

 

Thank you

 

 

 

Anonymous
Not applicable

Thank you for your quick reply.

 

Both filters from the same table.

 

I haven't created any slicers here, i wanted to use only filters to get the results. (filter on this page)

 

Is it possible?

 

I Have 2 filters below  Part Number & Part Family Num , when i select part number i will get only relevant values in part family number. this shouldn't happen, what i need is these 2 filters act independently . i wanted to select irrelevant values fom the both filters and get results.

Manasa_Rao_1-1637125848637.png

 

 

selimovd
Super User
Super User

Hey @Anonymous,

 

that depends a lot on your data model.

Are the two slicers from the same table? Are they from two different tables? How is the relationship? What should happen when someone selects values from both slicers?

 

Can you put together a sample file with your data model and give a little more information? Then I can help you with your request.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors