Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

group by and then concateate comma separated

Hi, 

I am new to powerbi and using CRM dynamics as datasource.

I have 4 tables, 1) activitypointers, 2) activityparties 3)incident 4) contacts

 

My current table visual is like this 

Ticket Number(incident)Activityid (activitypointer)partyid(activityparty)contact
1axxname
1ayyname
1azzname
2bbbname
3a1x1x1nam
3a2x2x2name

 

All I am expecting it to be is

ticketnmbercontact
1xname, yname, zname
2bname
3x1name, x2name


any help is highly appreciated.

Thanks,

Ashay

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

TomMartens's suggestion is helpful when the columns his formula used are all in the same table.

But, in your scenario, all these four columns are in four different tables.

It seems"incident" table and "contacts" table are not related directly, (from the Relationship view, there is no direct relationship between two tables), 

If your relationship is like

10.png

You could create a column in "contacts" table,

related_ticketnmber = RELATED(incident[Ticket Number])

Then create a measure or use TomMartens's measure

Measure = CONCATENATEX(FILTER(ALL(contacts),contacts[related_ticketnmber]=MAX(contacts[related_ticketnmber])),[contact],",")

9.png

If your relationship is not like that so that you can't create a column as above.

Please let me know what exactly relationships there are.

 

Best regards

Maggie

 

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

TomMartens's suggestion is helpful when the columns his formula used are all in the same table.

But, in your scenario, all these four columns are in four different tables.

It seems"incident" table and "contacts" table are not related directly, (from the Relationship view, there is no direct relationship between two tables), 

If your relationship is like

10.png

You could create a column in "contacts" table,

related_ticketnmber = RELATED(incident[Ticket Number])

Then create a measure or use TomMartens's measure

Measure = CONCATENATEX(FILTER(ALL(contacts),contacts[related_ticketnmber]=MAX(contacts[related_ticketnmber])),[contact],",")

9.png

If your relationship is not like that so that you can't create a column as above.

Please let me know what exactly relationships there are.

 

Best regards

Maggie

 

 

Anonymous
Not applicable

Hi Maggie,

Sorry for late reply. 
Actually, I have fixed this by myself. 
Step 1) I created custom column  = Related(contacts(fullname)) .

step 2 ) Created measure = 

Handoff Name = CONCATENATEX(VALUES(activityparties[PartyName]),activityparties[PartyName],", ")

It shows correct data, but I am getting an extra comma at begining of data. 
, Robert David, David Shaw, Morning Evening, Johnathon Arnold, Leslie Fejes

I tried to use Mid function, but after editing formula, visual keeps loading for some time and then shows error msg saying runs out of memory.. 

Any clue on this?? 

Kind Regards,
Ashay
TomMartens
Super User
Super User

Hey,

 

this measure:

concatenax contact = 
IF(HASONEVALUE('Table1'[Ticket Number(incident)])
    ,var tickets= VALUES('Table1'[Ticket Number(incident)])
    return
    CONCATENATEX(
        FILTER(
            ALL(Table1)
            ,'Table1'[Ticket Number(incident)] in tickets
        )
        ,'Table1'[contact]
        ,", "
    )
    ,BLANK()
) 

allows this:

image.png

Hopefully, this is what you are looking for.

 

Regards,
Tom



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

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.