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
cottrera
Post Prodigy
Post Prodigy

Concatenate 3 columns

Hi I wish to use DAX in power bi to concatenate 3 columns. However I would like to place hyphen symbol ( - ) between each concatenated column. Thanks Richard
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, Richard. @cottrera 

 

The quickest way to do this is using the ampersand & character. Like this,

 

Column D = [column a] & " - " & [column b] & " - " & [column c]

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi, Richard. @cottrera 

 

The quickest way to do this is using the ampersand & character. Like this,

 

Column D = [column a] & " - " & [column b] & " - " & [column c]

ésto me funciono realmente, Muchas Gracias

The proposed solution worked well in 2019 and for just three columns but in case anyone stumbles across this now, I would like to point out there is a better way that probably wasn't available in 2019


The DAX "COMBINEVALUES" function joins text using a delimiter.

COMBINEVALUES("-",Column1, Column2, Column2)


and this can be used for many more columns as well

Note that the delimiter cannot be a blank or empty string so if you don't want to join your values with a delimiter, then just use one that will definitely not be in the columns and then substitute it afterwards (e.g. "~" or similar).

SUBSTITUTE(
COMBINEVALUES("~",
Column1,
Column2,
Column3
),
"~",""
)

 

Fantastic. Reading in 2023, none of the above solved my issue (trying to Concat 3 columns when in DirectQuery), but this function did. Thank you!

Hi Anonymous, this was pretty **bleep** clever and saved my @ss. Thank you! 

Works perfect thank you for the quick reponse

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.