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
Anonymous
Not applicable

Evaluating a customer list and returning true/false

In one table ("CustomerOrders") I have a list of customer orders as follows:

CustomerIDOrderNumProductCategory
A1Mountain bike
A2Road bike
B3Mountain bike
C4Road bike
C5Mountain bike
D6Mountain bike

 

In another table ("Customers") I have a list of customers and I want to have a column that returns True/False whether the customer has ever purchased a road bike.  How would I code that true/false road bike column?

 

CustomerIDRoad Bike Purchased?
A?
B?
C?
D?

 

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@Anonymous assuming you have relationship between these table on custom, add new measure as below

 

Road Bike Purchased? =
VAR __countRoadBike = CALCULATE ( COUNTROWS ( OrderTable ), OrderTable[Product Category] = "Road Bike" )
RETURN
IF (  __countRoadBike > 0, "Yes", "No" )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Anonymous
Not applicable

Hi ,

 

You can try this measure

 

roadbikecalculation = if(calculate(count(Sheet1[ProductCategory]),Sheet1[ProductCategory]="Road Bike"),"Yes","No")
 
Please let me know if this helped you

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi ,

 

You can try this measure

 

roadbikecalculation = if(calculate(count(Sheet1[ProductCategory]),Sheet1[ProductCategory]="Road Bike"),"Yes","No")
 
Please let me know if this helped you
parry2k
Super User
Super User

@Anonymous assuming you have relationship between these table on custom, add new measure as below

 

Road Bike Purchased? =
VAR __countRoadBike = CALCULATE ( COUNTROWS ( OrderTable ), OrderTable[Product Category] = "Road Bike" )
RETURN
IF (  __countRoadBike > 0, "Yes", "No" )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

Top Kudoed Authors