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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sunb1
Frequent Visitor

Using OR in a RELATED calculated column - return value based on two related tables

Hi - PLEASE HELP!! 🙂

i have two lookup tables connected to a data table. Both can get me the column i want in the data table (ie, INDUSTRY), but through different relationships. Can I use the OR function in a RELATED calculated column so that it will retrieve the correct INDUSTRY based on EITHER lookup table 1 or lookup table 2?

 

 

Thank you!!!

1 ACCEPTED SOLUTION

So that's the approach i took, but i had to to do two calculated columns using RELATED and then a final column with an IF statement, saying if the answer is not satisfied from the first column, then use the second column. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@sunb1 try using variables to get this

Industry col final =

var ind1 = related(table 1 industry)

var ind2 = related(table 2 industry)

return if(condition, ind1,ind2)

 

if it is driven by filters then it will have to be a measure.

So that's the approach i took, but i had to to do two calculated columns using RELATED and then a final column with an IF statement, saying if the answer is not satisfied from the first column, then use the second column. 

Anonymous
Not applicable

@sunb1 hey just curious, isn't my ans the accepted solution to your problem?

Anonymous
Not applicable

I dont think you can use OR function in RELATED function.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.