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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
_JE_
Frequent Visitor

Calculated column based on presence of one type of value out of many values for one order number

Long time scroller, first time poster.

 

I have two tables related by order number.  Table1 orders have no duplicates, and table2 orders have as many duplicates as there are items on the order.  I want to create a calculated column in Table1 that populates a value based on the existence of a certain item in Table2.

 

In the example below, Calc_Column says Yes if Table2[Order] has Item x. 

 

Table1                                        Table2
Order Calc_Column             Order     Item
1        Yes                               1          x
2        No                               2          a
3        Yes                               3          b
4        No                               3          x
5        Yes                               3          z
6        No                               4          a
                                              5          a
                                              5          x
                                              6          b

Thanks everyone!

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@_JE_ 

The calculated column would be like this.

 

Calc_Column = 
IF (
    ISBLANK ( CALCULATE ( COUNTROWS ( Table2 ), Table2[Item] = "x" ) ),
    "No",
    "Yes"
)

jdbuchanan71_0-1651185173170.png

 

 

View solution in original post

2 REPLIES 2
_JE_
Frequent Visitor

This worked beautifully.  Thank you.

jdbuchanan71
Super User
Super User

@_JE_ 

The calculated column would be like this.

 

Calc_Column = 
IF (
    ISBLANK ( CALCULATE ( COUNTROWS ( Table2 ), Table2[Item] = "x" ) ),
    "No",
    "Yes"
)

jdbuchanan71_0-1651185173170.png

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors