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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
opticshrew
Resolver II
Resolver II

Creating a number range between two values

Hi all,

 

I'm trying to create a column which contains all values between to numbers. 

 

Example.

Start Number      End Number          Range
     1                4              1:2:3:4
     2                4               2:3:4
     3                4                3:4
     4                4                 4   

Any ideas on how I can achieve this?

 

I would've used some form of iteration however I don't believe Power Bi has this functionality yet.

 

Thanks,

J

 

 

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

Piece of cake for Power Query:

 

let
    Source = Table1,
    #"Added Custom" = Table.AddColumn(Source, "Range", each Text.Combine(List.Transform({[Start Number]..[End Number]},Text.From),":"))
in
    #"Added Custom"
Specializing in Power Query Formula Language (M)

View solution in original post

4 REPLIES 4
MarcelBeug
Community Champion
Community Champion

Piece of cake for Power Query:

 

let
    Source = Table1,
    #"Added Custom" = Table.AddColumn(Source, "Range", each Text.Combine(List.Transform({[Start Number]..[End Number]},Text.From),":"))
in
    #"Added Custom"
Specializing in Power Query Formula Language (M)
Anonymous
Not applicable

While using this Mquery, I am getting error"

SachinRawat_0-1708375185118.png
I am using an excel Data source:

SachinRawat_0-1708375420276.png

I want to create numbers between Start Number and End Number but i am getting error" Expression.Error: The field 'Start Number' of the record wasn't found."
My Mcode is: 

SachinRawat_1-1708375701137.png

 

 

Hi @MarcelBeug

 

Excellent, does the job niceley.

 

Thanks,

J

Anonymous
Not applicable

While using this Mquery, I am getting error"

SachinRawat_0-1708375185118.png
I am using an excel Data source:

SachinRawat_0-1708375420276.png

I want to create numbers between Start Number and End Number but i am getting error" Expression.Error: The field 'Start Number' of the record wasn't found."
My Mcode is: 

SachinRawat_1-1708375701137.png

Please help me on this.

 

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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