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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Bpark1994
Helper I
Helper I

Need Help With Dax! Calculated Column 1 to many. If text contains..

Hi,

 

Say i have 2 tables joined with a 1 to many relationship.

 

TableA

 

ID

1

2

3

 

TableB

 

ID | Status

1 | Rejected

1 | Approved

2 | Pending

2 | Invoiced

3 | Sent

3 | Pending

3 | Invoiced

 

I want to add a calculated column to TableA that checks to see if any of the corresponding IDs are invoiced and if so put a yes, if not put a no.

 

End result should look like the following

 

TableA

 

ID | Contains Invoiced?

1 | No

2 | Yes

3 | Yes

 

Thanks for any help!

 

1 ACCEPTED SOLUTION

@Bpark1994

 

Try this one

 

Column =
CONTAINS ( RelatedTable(TableB), [Status], "Invoiced" )

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

This may not be the best approach - but I would create a new calculated column on Table B of "isInvoiced" where the dax would look something like this - IF(Status="Invoiced","Yes","No") - then do a calcualted measure "Contains Invoiced" which is the MAX(isInvoiced) of this new column - "Yes" is above "No" in text,  so then row context should kick in on putting ID with this new Calculated Measure and show Yes if there is an Invoiced on it, and No if there is not.

Hi st3vemartin,

 

Unfortuanently when i do that and add the measure as a calculated column into TableA every row is just populated with "Yes" whether it is suppose to be or not.

@Bpark1994

 

Try this one

 

Column =
CONTAINS ( RelatedTable(TableB), [Status], "Invoiced" )

You're my hero

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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