Reply
abhilashmjoseph
New Member
Partially syndicated - Outbound

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

Syndicated - Outbound

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
Super User
Super User

Syndicated - Outbound

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
Super User
Super User

Syndicated - Outbound

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

Syndicated - Outbound

hello, @abhilashmjoseph 

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

Syndicated - Outbound

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

avatar user

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)