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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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