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
lkshck
Helper III
Helper III

Create filter with OR condition instead of AND

Hey,

I want to create a filter with an OR condition based on the following data:

SubscriptionNameTag.areaCost
Subscription1Tag150
Subscription2Tag2100
Subscription3Tag1150

Goal is to create a filter which contains a specific string of the SubscriptionName and a value of Tag.area. It should use an OR condition, because currently via the Visual filters i'm only able to have an AND condition if I put the SubscriptionName field on it and the Tag.area field. Will it be only possible via a new column or is there any other option?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lkshck ,

 

If you want to calculate the sum of Cost when SubscriptionName contains "Test" or Tag.area = "Tag1", please try:

Measure = CALCULATE(SUM('Table'[Cost]), FILTER('Table', 'Table'[Tag.area] = "Tag1"  || CONTAINSSTRING('Table'[SubscriptionName],"Test" )))

Output:

Eyelyn9_0-1649392274929.png

Best Regards,
Eyelyn Qin
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

3 REPLIES 3
Anonymous
Not applicable

Hi @lkshck ,

 

If you want to calculate the sum of Cost when SubscriptionName contains "Test" or Tag.area = "Tag1", please try:

Measure = CALCULATE(SUM('Table'[Cost]), FILTER('Table', 'Table'[Tag.area] = "Tag1"  || CONTAINSSTRING('Table'[SubscriptionName],"Test" )))

Output:

Eyelyn9_0-1649392274929.png

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@lkshck , You can use or like

 

calculate(Sum(Table[cost]), filter(Table, Table[Tag.area] = "Tag1"  || [SubscriptionName] = "Subscription1" ))

 

in case they are slicers you need to use an independent slicer

 

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

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

Hey, thank you for the help. This should work for me. One question to the value of both fields. Can I use it in the same way if I define just a string which is in the SubscriptionName? So full name will be something like "SubscriptionTest1" and I just want to define the value "test" in my measure.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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