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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
hasarinfareeth
Frequent Visitor

Concatenate column with a row identifier

Hi 

 

I have the data source as below in which I need to concatenate a specific column based on the row identifier.  Can you please help me in acxhiving this through DAX?

 

S NoNamePurchased Item
1SamCloth
2ChrisFood
1SamGift
3PeterShoes
2ChrisTickets
4DeanFlowers
3PeterCandy

 

Expected Result:

 

S NoNamePurchased Items - Concatenated
1SamCloth, Gift
2ChrisFood, Tickets
3PeterShoes, Candy
4DeanFlowers
2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@hasarinfareeth,

 

Try this measure:

 

Purchased Items - Concatenated = 
CONCATENATEX ( SUMMARIZE ( 'Table', 'Table'[S No], 'Table'[Purchased Item] ), 'Table'[Purchased Item], ", " )

 

DataInsights_0-1738426797829.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

divyed
Super User
Super User

Hello @hasarinfareeth ,

 

Use below dax for your purpose :

This will be slightly better in performance than SUMMERIZE.

GROUPBY

This function works similarly to SUMMERIZE , but instead of calculating aggregations, it just groups by the specified columns. Since you're not performing any aggregation (like summing or counting), GroupBY can be more direct and semantically cleaner in this context.

 

Purchased Items - Concatenated =
CONCATENATEX (
    SUMMARIZE (
        'Table',
        'Table'[SNO],
        "ConcatenatedItems",
        CONCATENATEX (
            FILTER (
                'Table',
                'Table'[SNO] = EARLIER('Table'[SNO])
            ),
            'Table'[Purchased_Item],
            ", "
        )
    ),
    [ConcatenatedItems],
    ", "
)
 
divyed_0-1738496416445.png

 

I hope this helps.

 

Did I answer your query ? Mark this as solution if this helps.

 

Warm Regards,

Neeraj Kumar

 

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/

View solution in original post

2 REPLIES 2
divyed
Super User
Super User

Hello @hasarinfareeth ,

 

Use below dax for your purpose :

This will be slightly better in performance than SUMMERIZE.

GROUPBY

This function works similarly to SUMMERIZE , but instead of calculating aggregations, it just groups by the specified columns. Since you're not performing any aggregation (like summing or counting), GroupBY can be more direct and semantically cleaner in this context.

 

Purchased Items - Concatenated =
CONCATENATEX (
    SUMMARIZE (
        'Table',
        'Table'[SNO],
        "ConcatenatedItems",
        CONCATENATEX (
            FILTER (
                'Table',
                'Table'[SNO] = EARLIER('Table'[SNO])
            ),
            'Table'[Purchased_Item],
            ", "
        )
    ),
    [ConcatenatedItems],
    ", "
)
 
divyed_0-1738496416445.png

 

I hope this helps.

 

Did I answer your query ? Mark this as solution if this helps.

 

Warm Regards,

Neeraj Kumar

 

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
DataInsights
Super User
Super User

@hasarinfareeth,

 

Try this measure:

 

Purchased Items - Concatenated = 
CONCATENATEX ( SUMMARIZE ( 'Table', 'Table'[S No], 'Table'[Purchased Item] ), 'Table'[Purchased Item], ", " )

 

DataInsights_0-1738426797829.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors