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
PZU_DGW
Regular Visitor

Combine values to one string with delimiter

My query has e.g. 3 values as a result, say 3 different names. How can I combine these names to 1 string with a delimiter between each name with DAX?

 

Greetings PZ

1 ACCEPTED SOLUTION

Problem solved. Sollution was realised by rearranging the relationsships between the datatables.

 

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

@PZU_DGW  Can you share some sample data?

 

Fowmy
Super User
Super User

@PZU_DGW 

If you need to add a new column that combines the values from three columns using delimiter like "-",  try:

= [Column1] & "-" & [Column2] & "-" & [Column3]

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks for your reply Fowmy.

 

The query-result is a result over 1 column and can be 1, 2 or sometimes 3 values. I like to combine these results to 1 string, with a constant delimiter, like "-", between every value.

 

Hope I explained it better 😉

 

Gr. PZU


@PZU_DGW 

Provide sample data, you can copy-paste here. do you need to do it in Power Query or DAX?

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Sorry guys, I have only a printscreen, no code. As you kan see in de topright, you can select a contract. A contract contains 1,2 and sometimes 3 members/persons. When a contract is selected, the details show below. In this case 3 members (now only their partyID for security-resons insteat of their full names)

 

Finaly i like to show 1 string with the 3 PartyID's seperated with a delimiter.

 

Is it possible to upload the pbix-file?

 

 

Example.png

@PZU_DGW 

Try this measure: You can drop it in a card visual.

PartyID String =

CONCATENATEX(
VALUES(Table[PARTYID]),Table[PARTYID],", ")

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Ok, due to vacancy and personal situation, I haven't been able to reply for a while.

 

The given answer is not completely satisfying.  The string generated contains all partyID's, instead of the partyID's filtered by contract. This way, the generated string contains only the 3 - 2 or just 1 name(s) related to the contract.

 

Any suggestions?

 

@PZUDGW 

As per the screenshot that you have shared, I can see that there are three PartyIDs visible. The formula should return one string with those three PartyID when you select the contract H000033.

Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy,

 

you can find the file here.

 

I'd like to have the description (of partyID's) at the end of each contract row.

 

Thanks for helping me!

Problem solved. Sollution was realised by rearranging the relationsships between the datatables.

 

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.

Top Solution Authors