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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.