Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Everyone,
I have 2 separate table (Table1 and Table2) and would like to create a calculated column on the Table1 to return the value based on Table2 2columns.
| Table1 | ||
| Invoice | Items | Desired Output |
| 12345 | Banana apple grapes orange | Package1,Package2 |
| 123456 | apple orange | No Match |
| 123457 | Banana orange apple | Package2 |
| Table 2 | ||
| PackageType | ItemA | ItemB |
| Package1 | grapes | orange |
| Package 2 | banana | orange |
Many thanks for the help.
Solved! Go to Solution.
You can do this using a calculated column in Table1 that checks both ItemA and ItemB from Table2 and returns all matching package names.
Calculated column (Table1):
Desired Output =
VAR txt = LOWER('Table1'[Items])
VAR match =
ADDCOLUMNS (
'Table2',
"@pkg",
IF (
CONTAINSSTRING ( txt, LOWER('Table2'[ItemA]) ) &&
CONTAINSSTRING ( txt, LOWER('Table2'[ItemB]) ),
'Table2'[PackageType]
)
)
VAR result =
CONCATENATEX ( FILTER ( match, [@pkg] <> BLANK() ), [@pkg], ", " )
RETURN IF ( result = BLANK(), "No Match", result )
You can do this using a calculated column in Table1 that checks both ItemA and ItemB from Table2 and returns all matching package names.
Calculated column (Table1):
Desired Output =
VAR txt = LOWER('Table1'[Items])
VAR match =
ADDCOLUMNS (
'Table2',
"@pkg",
IF (
CONTAINSSTRING ( txt, LOWER('Table2'[ItemA]) ) &&
CONTAINSSTRING ( txt, LOWER('Table2'[ItemB]) ),
'Table2'[PackageType]
)
)
VAR result =
CONCATENATEX ( FILTER ( match, [@pkg] <> BLANK() ), [@pkg], ", " )
RETURN IF ( result = BLANK(), "No Match", result )
Thank you very much!!!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 17 | |
| 10 | |
| 7 | |
| 6 |