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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abhilashmjoseph
New Member

How can I add additional duplicate rows in Power BI based on a specific number in a column?

Hi,

I would like to explore options for adding additional duplicate rows in Power BI based on a specific number in a column. For instance, as illustrated below, I aim to replicate my rows the same number of times as indicated in the 'Span(Months)' column. Can someone suggest an automated method for achieving this?

 2023-12-01 13_12_57-Window.png

2 ACCEPTED SOLUTIONS
AlienSx
Super User
Super User

hello, @abhilashmjoseph 

    to_list = Table.TransformColumns(your_table, {"Span (Months)", (x) => List.Repeat({1}, x)}),
    expand = Table.ExpandListColumn(to_list, "Span (Months)")

View solution in original post

spinfuzer
Solution Sage
Solution Sage

You could add a custom column which creates list from 1 to span and then expand column to new rows.

={1 .. [Span (Months)] }

 

View solution in original post

3 REPLIES 3
spinfuzer
Solution Sage
Solution Sage

You could add a custom column which creates list from 1 to span and then expand column to new rows.

={1 .. [Span (Months)] }

 

AlienSx
Super User
Super User

hello, @abhilashmjoseph 

    to_list = Table.TransformColumns(your_table, {"Span (Months)", (x) => List.Repeat({1}, x)}),
    expand = Table.ExpandListColumn(to_list, "Span (Months)")

Thnak you for the response , but not quite clear can you please elaborate ? 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.