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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
TusharGaurav
Helper III
Helper III

How to have filters with OR condition in Power Bi desktop

Hi Experts,

 

I need to use a filtercondition where I want to show data as below:

Product.ProductName ="Apple"

or

Geography.Region = "US".

I need to create a filter for the same in power bi,but I cant create a filter with "OR".

Can you please suggest, how I can overcome this challenge.

 

Thanks and Regards,

Tushar Gaurav

 

 

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@TusharGaurav,

 

Try this measure:

 

OR Filter =
VAR vFilterTable =
    FILTER (
        CROSSJOIN ( ALL ( 'Product'[ProductName] ), ALL ( Geography[Region] ) ),
        'Product'[ProductName] = "Apple"
            || Geography[Region] = "US"
    )
VAR vResult =
    CALCULATE ( SUM ( FactTable[Amount] ), KEEPFILTERS ( vFilterTable ) )
RETURN
    vResult

 

https://www.sqlbi.com/articles/specifying-multiple-filter-conditions-in-calculate/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hi @TusharGaurav 

The solution @DataInsights  offered is excellent,  and you can also consider the following solution.

If you want to control the filter, you can create a measure.

Measure =
IF (
    OR (
        SELECTEDVALUE ( 'Product'[ProductName] ) = "Apple",
        SELECTEDVALUE ( 'Geography'[Region] ) = "US"
    ),
    1,
    0
)

Then put the measure to the visual filter, and set the condition that the measure is equal to 1.

vxinruzhumsft_0-1710829811427.png

 

 

Best Regards!

Yolo Zhu

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

Hi All,

Thanks for your reply.

Your response is really helpfull. 🙂

Anonymous
Not applicable

Hi @TusharGaurav 

The solution @DataInsights  offered is excellent,  and you can also consider the following solution.

If you want to control the filter, you can create a measure.

Measure =
IF (
    OR (
        SELECTEDVALUE ( 'Product'[ProductName] ) = "Apple",
        SELECTEDVALUE ( 'Geography'[Region] ) = "US"
    ),
    1,
    0
)

Then put the measure to the visual filter, and set the condition that the measure is equal to 1.

vxinruzhumsft_0-1710829811427.png

 

 

Best Regards!

Yolo Zhu

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

 

DataInsights
Super User
Super User

@TusharGaurav,

 

Try this measure:

 

OR Filter =
VAR vFilterTable =
    FILTER (
        CROSSJOIN ( ALL ( 'Product'[ProductName] ), ALL ( Geography[Region] ) ),
        'Product'[ProductName] = "Apple"
            || Geography[Region] = "US"
    )
VAR vResult =
    CALCULATE ( SUM ( FactTable[Amount] ), KEEPFILTERS ( vFilterTable ) )
RETURN
    vResult

 

https://www.sqlbi.com/articles/specifying-multiple-filter-conditions-in-calculate/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors