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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Concatenate value with a group by in a new column

Hello,

 

I would like to concatenante Item in a new column (Item Final) per Category (group by) and without duplicates

Input : 

 

Field1Field2CategoryItem
 Test1MULA
Group1Test1NGA 
 Test1NIMI 
 Test1NIMIA
 Test1NIMIB
 Test1NIMIA

 

Output : 

 

Field1Field2CategoryItemItem Final
 Test1MULAA
Group1Test1NGA  
 Test1NIMI A-B
 Test1NIMIAA-B
 Test1NIMIBA-B
 Test1NIMIAA-B

 

For exemple for each Category=  NIMI the Item Final should be equal to the concatentation of item value for NIMI

Thanks for your help,

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You could create a column as below:-

Column = 
VAR cat_ = 'Table'[Category]
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            DISTINCT ('Table'[Item]),
            FILTER ( 'Table', 'Table'[Category] = cat_ && 'Table'[Item] <> BLANK())
        ),
        'Table'[Item],
        ","
    )

Output:-

Samarth_18_0-1655141078498.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You could create a column as below:-

Column = 
VAR cat_ = 'Table'[Category]
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            DISTINCT ('Table'[Item]),
            FILTER ( 'Table', 'Table'[Category] = cat_ && 'Table'[Item] <> BLANK())
        ),
        'Table'[Item],
        ","
    )

Output:-

Samarth_18_0-1655141078498.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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