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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors