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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Trouble with List.Generate

I have two whole number columns, "Min G/L Account No." and "Max G/L Account No.". I'm trying to create a new, calculated column which contains a list of each whole number between those two (in increments of 1). To do this, I'm using the following query in the Custom Column dialog:

 

List.Generate(
() => ([#"Min G/L Account No."]),
each _ <= ([#"Max G/L Account No."]),
each _ + 1
)

 

It accepts the formula, but each field in the newly created list column contains the following error:

 

Expression.Error: We cannot apply field access to the type Number.
Details:
Value=10020 (NOTE: this value changes per row)
Key=Max G/L Account No.

 

I've confirmed I can create a list of numbers by just changing the values in the formula to hard coded numbers, but cannot figure out what I'm doing wrong with the formula that is resulting in the error.

 

Any help would be much appreciated! Thank you in advance!

 

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try this in a new custom column:

{ [#"Min G/L Account No."]..[#"Max G/L Account No."] }

 

Note the curly braces.

 

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 @Anonymous ,

 

Try this in a new custom column:

{ [#"Min G/L Account No."]..[#"Max G/L Account No."] }

 

Note the curly braces.

 

Pete



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

Proud to be a Datanaut!




Anonymous
Not applicable

That worked perfectly - thanks, Pete!

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors