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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
lboldrino
Resolver I
Resolver I

Create a new column from more columns other table

i have two tables_ fact_fahrzeuge:

kennzeichen
W12300
W12301
W12302
W12303
W12304
W12305
W12307

 

dim_sachkonto

counternamepositiontextbez
1name1W12300 in text 1 W12300_555565
2name2W12301  in text   
3name3W12302  in text 11W12302_34543W12302 dkfkjregn
4name4W12303  in text 2 W12303 terere
5name5W12304  in text 3 W12304 fjjgt
6name6bzzzW!2305-text2 
7name7W12306  
8name8W12307 ztutz  

 

i need a new column "kennzeichen_col" in dim_sachkonto, if position or text or bez contains kennzeichen from fact_fahrzeuge.

 

counternamepositiontextbezKennzeichen_col
1name1W12300 in text 1 W12300_555565W12300
2name2W12301  in text   W12301
3name3W12302  in text 11W12302_34543W12302 dkfkjregnW12302
4name4W12303  in text 2 W12303 terereW12303
5name5W12304  in text 3 W12304 fjjgtW12304
6name6bzzzW12305-text2 W12305
7name7W12306   
8name8W12307 ztutz  W12307

 

any idea please! 🙂

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @lboldrino 

 

You can create a column with below code

 

Column = 
CALCULATE(FIRSTNONBLANK(fact_fahrzeuge[kennzeichen],1),
FILTER(ALL(fact_fahrzeuge),CONTAINSSTRING(dim_sachkonto[bez],fact_fahrzeuge[kennzeichen]) || 
CONTAINSSTRING(dim_sachkonto[position],fact_fahrzeuge[kennzeichen]) ||
CONTAINSSTRING(dim_sachkonto[text],fact_fahrzeuge[kennzeichen])))

 

Samarth_18_1-1626443559977.png

 

Note:- W12305 it is not coming for me because its copied as  W!2305 in my data table. But it will works for you 🙂

Thanks

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @lboldrino 

 

You can create a column with below code

 

Column = 
CALCULATE(FIRSTNONBLANK(fact_fahrzeuge[kennzeichen],1),
FILTER(ALL(fact_fahrzeuge),CONTAINSSTRING(dim_sachkonto[bez],fact_fahrzeuge[kennzeichen]) || 
CONTAINSSTRING(dim_sachkonto[position],fact_fahrzeuge[kennzeichen]) ||
CONTAINSSTRING(dim_sachkonto[text],fact_fahrzeuge[kennzeichen])))

 

Samarth_18_1-1626443559977.png

 

Note:- W12305 it is not coming for me because its copied as  W!2305 in my data table. But it will works for you 🙂

Thanks

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

fhill
Resident Rockstar
Resident Rockstar

What happens if Position = "W12300" and Text contains "W12301", etc?  Do you wan an Error Result if conflicting data in the columns, or do you want the columns to have an Success Order, ignoring the other columns if a result is found?

 

Forrest




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




What happens if Position = "W12300" and Text contains "W12301" - not possible. 

but for example W12306 is not exist in dim_sackkonto, deshalb null

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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