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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anshpalash
Helper II
Helper II

Duplicate each row 2 times

Hi all,

I have a dataset in the form:

CodeDuplicate Number
Manual 2
Camera2
123 - Data2

 

I want to duplicate each row two times so that I get output in the format:

Code
Manual 
Manual 
Camera
Camera
123 - Data
123 - Data

 

To achieve the output, I created a custom column using:  List.Repeat([Code],[Duplicate Number])

 

However, I am getting an error: We cannot convert the value "Manual" to type List.

Can someone please advise on how to achieve the output I am trying to get?

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @anshpalash ,

 

You could add a new custom column with the following code:

{1..2}

 

This should give you an expandable list column that you can 'Expand to New Rows'.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @anshpalash ,

 

You could add a new custom column with the following code:

{1..2}

 

This should give you an expandable list column that you can 'Expand to New Rows'.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors