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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply

Merge rows based on criteria

I want to merge the rows based on ID . 

This is my raw data table.

IDModelPriceQuantity
OVSIL22122018834-1A2330
OVSIL22122018834-1B2330
OVSIL22122018834-2C2760
OVSIL22122018834-2D2760

 

And the the table i would like to get is;

IDModelPriceQuantity
OVSIL22122018834-1A,B23

30

OVSIL22122018834-2C,D2760
1 ACCEPTED SOLUTION
latimeria
Solution Specialist
Solution Specialist

Hi @PhyuLayKhine333 ,

 

You cant try this:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8g8L9vQxMjI0MjIwtLAwNtE1VNJRcgRiI2MgYWygFKuDQ5ETIUVGQDlnkCJzIGGGR5ELsqJYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Model = _t, Price = _t, Quantity = _t]),
    #"Grouped Rows" = Table.Group(Source, {"ID", "Price", "Quantity"}, {{"Rows", each _, type table [ID=nullable text, Model=nullable text, Price=nullable text, Quantity=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Model", each Table.Column([Rows],"Model")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Model", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Removed Columns" = Table.RemoveColumns(#"Extracted Values",{"Rows"})
in
    #"Removed Columns"

 

latimeria_0-1672395226014.png

 

View solution in original post

1 REPLY 1
latimeria
Solution Specialist
Solution Specialist

Hi @PhyuLayKhine333 ,

 

You cant try this:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8g8L9vQxMjI0MjIwtLAwNtE1VNJRcgRiI2MgYWygFKuDQ5ETIUVGQDlnkCJzIGGGR5ELsqJYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Model = _t, Price = _t, Quantity = _t]),
    #"Grouped Rows" = Table.Group(Source, {"ID", "Price", "Quantity"}, {{"Rows", each _, type table [ID=nullable text, Model=nullable text, Price=nullable text, Quantity=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Model", each Table.Column([Rows],"Model")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Model", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Removed Columns" = Table.RemoveColumns(#"Extracted Values",{"Rows"})
in
    #"Removed Columns"

 

latimeria_0-1672395226014.png

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.