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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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())

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())

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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