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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors