cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vitexo87
Post Prodigy
Post Prodigy

concatenate values

I need to unite the values of fields of type text in two different tables, how can I do?

1 ACCEPTED SOLUTION

Hi @vitexo87,

 

You can nested CONCATENATE() within CONCATENATE() to add concatenate more characters you need.

 

CONCATENATE(string_expression,CONCATENATE(string_expression,string_expression))

 

Regards,

View solution in original post

8 REPLIES 8
qwertzuiop
Advocate II
Advocate II

Hello there,

 

To connect my divisions, I use this. I wanted to share them with you.

Relation = [startLocation] & " ->" & [targetLocation)]
 
In addition, any string can be selected as the connection: Here ->
 
Cheers qwertzuiop

Well it depends. Are the tables related?  Are you writing a measure or a calc column?  Why do you want to do this - IE what are you trying to achieve and why?



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

The tables are related and I'm wanting to apply to a measure

Hi vitexo87,

 

If these two tables are related, you can use LOOKUPVALUE() function to import the expected column into current table based on the related column. And concatenate it with existing column.

 

=CONCATENATE(table1[Column],

LOOKUPVALUE(table2[ExpectColumn],table2[RelatedColumn],table1[RelatedColumn])

)

 

Then involve this calculated column in your measure.

 

Reference:
LOOKUPVALUE Function (DAX)

CONCATENATE Function (DAX)

 

Regards,

 

What if I need to add a character in the middle of the information that will be formed, for example a "-"?

Hi @vitexo87,

 

You can nested CONCATENATE() within CONCATENATE() to add concatenate more characters you need.

 

CONCATENATE(string_expression,CONCATENATE(string_expression,string_expression))

 

Regards,

I would usually just do the excel way ie. =(Value1)&" - "&(Value 2), I find it quicker and easier then using a function. 

Ok, you assuming you are writing a measure over your data table, you can use the RELATED() function to do what you want. https://msdn.microsoft.com/en-us/library/ee634202.aspx

 

If you are writing a measure over a lookup table, there is a RELATEDTABLE function, but this may be an issue as it will return multiple rows of data.



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors