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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
laui
Frequent Visitor

Generate list with double characters

Hi there,

 

As titled. I wish to generate a list {M04..M10} to M04, M05, M06, M07, M08, M09, M10. Is there an function similar to List.Numbers that can help?

 

Isaac

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi laui,

 

To achieve your requirement, you can use M code like below:

 

let
    Source =  List.Numbers(4, 7, 1),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Concatenate" = Table.AddColumn(#"Converted to Table", "Concatenate Column", each if [Column1] >= 10 then "M" & Text.From([Column1]) else "M0" & Text.From([Column1])),
    #"Concatenate Column" = Concatenate[Concatenate Column]
in
    #"Concatenate Column"

4.PNG

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi laui,

 

To achieve your requirement, you can use M code like below:

 

let
    Source =  List.Numbers(4, 7, 1),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Concatenate" = Table.AddColumn(#"Converted to Table", "Concatenate Column", each if [Column1] >= 10 then "M" & Text.From([Column1]) else "M0" & Text.From([Column1])),
    #"Concatenate Column" = Concatenate[Concatenate Column]
in
    #"Concatenate Column"

4.PNG

 

Regards,

Jimmy Tao

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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