The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hey,
I want to create a filter with an OR condition based on the following data:
SubscriptionName | Tag.area | Cost |
Subscription1 | Tag1 | 50 |
Subscription2 | Tag2 | 100 |
Subscription3 | Tag1 | 150 |
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?
Solved! Go to Solution.
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:
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.
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:
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.
@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
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.