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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PowerBIGpig
Frequent Visitor

Creating a column based on the string value from another table

Hello!

I'm having problems... among many, I am trying to create a column in a table that will collect the name from another table and add it into this column...

Table 1 (Acc/Act/Comm/Web)

Purchase item textAmountWBS
ABC.1 item1230100001
XYZ120100003
random item450100003
ABC.1 item240000200001
DEF item 1200100002
other random item100100002

 

I have table 2

(Activity List)

Work PackageActivityWBSCapital WBS
ABCABC.1100001200001
ABCABC.2100001200001
ABCUNKNOWN1100001200001
DEFDEF.1100002200002
DEFUNKNOWN2100002200002
XYZXYZ.1100003200003
XYZUNKNOWN3100003200003

 

I would like to use Activity column in the Activity List table to to search through the string in the Purchase Item Text column to determine which Activity the item relates to, if the Purchase Item Text doesn't have the Activity in the string then the result should be the Unknown# that corresponds with the WBS. I'm hoping for a result such as this:

Purchase item textAmountWBSActivity
ABC.1 item1230100001ABC.1
XYZ.1120100003XYZ.1
random item450100003Unknown3
ABC.1 item240000200001ABC.1
DEF.1 item 1200100002DEF.1
other random item100100002Unknown2

Please help!

1 REPLY 1
Anonymous
Not applicable

This is not a job for DAX. It's for Power Query.

Best
D

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors