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
Anonymous
Not applicable

Question: Keep repeating a list in a new column until the last row.

Hi there,

 

I was wondering if anyone can help me understand how I can repeat a list of 5 values in a new column in a table of 100 rows. For example, I have created a list of values corresponding to "Class number" (1,1,8,50,10). Now I would like to add a column to this table in the screenshot which goes upto 100 rows and the column should have the values in the list in a repeating manner. 

 

 

image.png

 

Thanks in advance 

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

So, instead of hardcoding the list, just refer to your list like,
image.png

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn



View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Go to Add Column > Custom Column, type your list as below
image.png

Later just expand the list

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Hi @Mariusz Mariusz,

 

Thanks for your reply. The list is already created as I extracted the required values from the main table and turned it into a list, now I am looking to expand an existing list into a new column and stuck in that step. I am trying my best to not hard code any values and keep the process as generic as possible so that this sheet that I am working on can be used for transforming ongoing data sets without any changes in the code/steps/process. Kind of like a template or work flow.

 

2 lists are created on the left, I need to make them repeat as new columns in the main table2 lists are created on the left, I need to make them repeat as new columns in the main table

Anonymous
Not applicable

Hi @Mariusz ,

 

I was able to figure it out. Here is the code.

 

image.png

Hi @Anonymous 

 

So, instead of hardcoding the list, just refer to your list like,
image.png

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn



Anonymous
Not applicable

Hi @Mariusz ,

 

I think I celebrated too soon :(. It appears that when the list expanded, it didn't expand each value corresponding to the rows in the Main Table, instead it duplicated the rows in the maintable to expand the whole list and then repeat the process.

 

See the difference between before and after expanding the list, notice how the values on the left duplicate themselves. I wanted the list to open corresponding to each row, any ideas on how I can achieve that?

 

image.pngimage.png

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.