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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
slatesha
New Member

Concatenate down a column based on another column?

I would like to create a custom column to concatenate the ORDERNUM number based on SHIPPLANT. 

i.e.

011 - 04779,04780,04782,04784

022 - 04872,04902

026 - 04827,04828

Any Ideas?

 

 

slatesha_0-1706034892821.png

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@slatesha 

You can use GROUP BY and modify the code as follows.
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and follow the steps.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XcnBCQAgCADAXXz7UInUWcT91wikAn0eFwG0VB0QiBkSy0bDMryaTetFrp26TbS8v+05Dw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ORDERNUM = _t, SHIPPLANT = _t]),


    #"Grouped Rows" = Table.Group(Source, {"SHIPPLANT"}, {{"ORDERNUM-CONCAT", each Text.Combine([ORDERNUM],","), type nullable text}})


in
    #"Grouped Rows"

Fowmy_0-1706038955315.png

 




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

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@slatesha 

You can use GROUP BY and modify the code as follows.
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and follow the steps.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XcnBCQAgCADAXXz7UInUWcT91wikAn0eFwG0VB0QiBkSy0bDMryaTetFrp26TbS8v+05Dw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ORDERNUM = _t, SHIPPLANT = _t]),


    #"Grouped Rows" = Table.Group(Source, {"SHIPPLANT"}, {{"ORDERNUM-CONCAT", each Text.Combine([ORDERNUM],","), type nullable text}})


in
    #"Grouped Rows"

Fowmy_0-1706038955315.png

 




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

Thank you that worked I was overlooking the group function. 

 

slatesha
New Member

***USING Power Query for excel, dont have the option to use concatx. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors