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
Anonymous
Not applicable

Concatenate field in PBI

I have data looking like this:

Ticket   Tech
233450 qmi3
233450 top3t3
233716 hql8qoh
233893 wqd
234081 app3on
234179 momqt3
234179 hqw

 

I would like to create a DAX field that concatenates the Tech field so the data looks like this:

Ticket   Tech
233450 qmi3,top3t3
233716 hql8qoh
233893 wqd
234081 app3on
234179 momqt3,hqw

All help is much apprecated!

7 REPLIES 7

Well, this can be done in Power Query or DAX. Which is best depends on what you are wanting to do with it. In DAX, you could write a measure like this. 

CONCATENATEX(TableName,TableName[Tech],",")

 

place the ticket column in a matrix on rows and the measure above in the values section



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

Matt, I'm using Direct Query and need to buils the field in DAX,
I tried thie formula you gave me and it just places a comma after the existing field.
I need to concatenate the data from other rows when the Ticket ID is the same.

You need to change my formula TableName and TableName[ColumnName] to match your model



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

Yes, I changed the formula to this: TechConcat = CONCATENATEX(Installs,Installs[TECH],",")
I get this error: 

Error Message:
ORA-01704: string literal too long. The exception was raised by the IDbCommand interface.

 

my guess is that this is the total row.  Try this

 

= IF(ISFILTERED(Installs[TECH]),CONCATENATEX(Installs,Installs[TECH],","))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

Ticket and Tech are columns in my Oracle db.  The query returns 4500 rows with Ticket as the id field and a Tech is on each row.  

TICKET  INSTALLER
166779  bler
166779  shan

Anonymous
Not applicable

Why is my post showing in Spanish? I can't figure how to change it back?

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.