cancel
Showing results for 
Search instead for 
Did you mean: 
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
Solution Sage
Solution Sage

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

View solution in original post

3 REPLIES 3
Samarth_18
Solution Sage
Solution Sage

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

View solution in original post

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!


I’ll be speaking at #MySummitNA this year.
Check out all the sessions, including mine here: https://hubs.ly/H0SXmgH0
I hope to see you in Houston October 12-15 #MySummitNA

Proud to be a Super User helping 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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!