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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Duplicate Rows

Hello All,

 

I have the dataset as the following:

 

Part Number           Item description

026 48202 000        Catridge

026 35601 000         Oil

 

 

I need duplicate both the columns by four same rows . I have attached the screenshot of the final result.Any help will be appreciated.

 

Thank You

Iva

1 ACCEPTED SOLUTION

try this query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAyUzCxMDIwUjAwMFDSUXJOLCnKTElPVYrVgUgam5oZGEIl/TNzlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Part Number" = _t, #" Item description" = _t]),
    GroupRows = Table.Group(Source, {"Part Number"}, {{"All", each _, type table}}),
    CustomRepeat = Table.AddColumn(GroupRows, "Repeat", each Table.Repeat([All],4)),
    RemoveOtherColumns = Table.SelectColumns(CustomRepeat,{"Repeat"}),
    Expand = Table.ExpandTableColumn(RemoveOtherColumns, "Repeat", {"Part Number", " Item description"}, {"Part Number", " Item description"})
in
    Expand

 /Melanie

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

You can define a new custom column as a list {1,2,3,4} or, equivalently, {1..4} and then expand that new column by clicking the expand button: AlexisOlson_1-1645821409933.png

 

Add column:

AlexisOlson_2-1645821569943.png

 

Expand column:

AlexisOlson_3-1645821622179.png

AlexisOlson
Super User
Super User

I don't see any screenshots.

Anonymous
Not applicable

Iva_1-1645820282031.png

 

try this query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAyUzCxMDIwUjAwMFDSUXJOLCnKTElPVYrVgUgam5oZGEIl/TNzlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Part Number" = _t, #" Item description" = _t]),
    GroupRows = Table.Group(Source, {"Part Number"}, {{"All", each _, type table}}),
    CustomRepeat = Table.AddColumn(GroupRows, "Repeat", each Table.Repeat([All],4)),
    RemoveOtherColumns = Table.SelectColumns(CustomRepeat,{"Repeat"}),
    Expand = Table.ExpandTableColumn(RemoveOtherColumns, "Repeat", {"Part Number", " Item description"}, {"Part Number", " Item description"})
in
    Expand

 /Melanie

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors