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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
mgrayTCB
Helper IV
Helper IV

List.Generate fixed number of items

I am trying to generate a list in PQ based on a filed value. I always want the list to be the same number of items. So for earch record in the table I want a list 12 items long. The value of all 12 items would be equal to the Amount Field on the record.

 

I can get the right value in the list but I cant figure out how to limit the list to just 12 items. How do I add a counter or something to limt it to 12 times?

 

List.Generate(

() => [Amt], // the starting value
each _ > 0, // as long as the value greater than 0
each _

)

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

12 items equal to [Amt] field???

each List.Repeat({[Amt]}, 12)

View solution in original post

1 REPLY 1
AlienSx
Super User
Super User

12 items equal to [Amt] field???

each List.Repeat({[Amt]}, 12)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.