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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mroomi
Helper II
Helper II

How to do OR between two columns?

Hi All,

So currently I can do an OR in filters on one column e.g, If Date is less then "1" OR Greater than "10". But I want to do an OR between two columns.

 

If [code1] is 290 OR [code2]  is 310 then do this.

 

Thanks.

 

1 ACCEPTED SOLUTION
samdthompson
Memorable Member
Memorable Member

there will be a smarter way but make a third column which holds your =OR() function then reference that for your measure. If something might be used as a filter or used in a relative context keep it in a column rather than a measure.

 

 

 

 

//if this is a solution please mark as such

// if this is a solution please mark as such. Kudos always appreciated.

View solution in original post

6 REPLIES 6
samdthompson
Memorable Member
Memorable Member

there will be a smarter way but make a third column which holds your =OR() function then reference that for your measure. If something might be used as a filter or used in a relative context keep it in a column rather than a measure.

 

 

 

 

//if this is a solution please mark as such

// if this is a solution please mark as such. Kudos always appreciated.
samdthompson
Memorable Member
Memorable Member

there will be a smarter way but make a third column which holds your =OR() function then reference that for your measure. If something might be used as a filter or used in a relative context keep it in a column rather than a measure.

 

 

 

 

//if this is a solution please mark as such

// if this is a solution please mark as such. Kudos always appreciated.
Anonymous
Not applicable

Taking a guess at what you are looking for... likely this works...

 

  = CALCULATE ( [MyMeasure], FILTER (MyTable, MyTable[Code1] = 290 || MyTable[Code] = 310)

 

Thanks Scottsen,

But I wanted to do this at report level, where user can achive this using the report level filters.

Or else I have to create multiple measures and the biggest problem is to filter doesnt work on the visual when you use the measures.

@mroomi

 

So far the report level filter can't acheive your requirement. You can submit your feedback on Power BI Ideas.

 

You may follow @Anonymous's advice to use lookup tables. For example, one table for code1 range and another for code2 range, use two slicers and create two measures to get the selected range number. Then apply those two measures to your DAX fomulas.

 

 

Anonymous
Not applicable

That... is going to be challenging.

 

Hopefully somebody else chimes in with an idea.  The only thing I can think of is having lookup tables that are NOT related to your fact table (otherwise the default AND behavior will take over), then write some tricky DAX measures to filter the fact rows based on selections in the "disconnect tables" based on an OR pattern.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors