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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.