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
Kurt4597
Helper I
Helper I

Conditional Column based on link between another table

Hello PowerBI Community, I am stuck on a problem and would be very greatful if somebody could assist me.

 

Table 1 - Customer List

Kurt4597_1-1662727396079.png

 

Table 2 - Order

Kurt4597_2-1662727421732.png

 

These tables have a Many to 1 link on CustomerID. So a customer can have multiple orders

 

I am trying to create a conditional column in the customer list table to determine if the orders created could meet a certain criteria. For example 

 

If this one of the orders from a customer contains Apple OR If a Large Fruit then TRUE, ELSE FALSE. The end result would be an additional column on the customer list table containing true / false values.

 

Any help would be massively appreciated!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Kurt4597 ,

a new column in customer

 

new column =

var _cnt = countx(filter(order, order[customerid] = customer [customerid] && ( [Fruit] ="Apple" || [Size] ="Large") ) , order[CustomerID])

return

if(isblank(_cnt), false(), True())

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Kurt4597 ,

a new column in customer

 

new column =

var _cnt = countx(filter(order, order[customerid] = customer [customerid] && ( [Fruit] ="Apple" || [Size] ="Large") ) , order[CustomerID])

return

if(isblank(_cnt), false(), True())

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

Thank you for the help,

 

Do you know how I can solve it now for three tables? For example I have added a 3rd table

Kurt4597_0-1662732792422.png


This is connected to the ORDERS table with a many to one relationship. So now we have this

Kurt4597_1-1662732906137.png

 

So now if I wanted to create the SAME column as before, except now with an added condition

If this one of the orders from a customer contains Apple OR If a Large Fruit OR if they have an order price over £2 then TRUE, ELSE FALSE. The end result would be an additional column on the customer list table containing true / false values.

 

Thank you Amitchandak!

 

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.