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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
SebFelSch
New Member

How to change column format?

Hello,

 

I want to change in a column the text from 1,2,3,4,5...,11,12,13,...111,112,113 to 001,002,003,...,011,...111,112,113.

 

I tried format(text,"000") but it does not work.

 

My problem is that I join 3 columns to a key e.g. VS00001-1-1 and I want that it looks like VS00001-01-001 and so on.

 

Someone an idea.

 

Thank you for your help and time!

1 ACCEPTED SOLUTION

You will need to add a custom column, and then add the following formula.

 

=Text.PadStart(Number.ToText([Column1]),4,"0")

 

The red section converts the numeric column to text.  This is required before you can pad out from the left

The blue section then pads out the text string to be (in this case 4 characters long using a "0" as the padding character).



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

6 REPLIES 6
BhaveshPatel
Super User
Super User

You can use Custom Column in Query Editor,

 

As shown in the screenshot, Write Custom Column and once it is done delete your original column if not required.

 

Alternatively, You can use CONCATENATE function as well.

customcolumn.PNG

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Hello Bhavesh,

 

this did not work out because it is the same like to add a präfix.

 

1 turns to 001

41        to 0041

 

I need

 

1   to 001

41 to 041

 

But thank you for the idea!

 

The CONCATENATE function also doesn't help. I tried before and it does not work like in excel.

You will need to add a custom column, and then add the following formula.

 

=Text.PadStart(Number.ToText([Column1]),4,"0")

 

The red section converts the numeric column to text.  This is required before you can pad out from the left

The blue section then pads out the text string to be (in this case 4 characters long using a "0" as the padding character).



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

perfekt thank you Matt!

 

also a big thank you for the explanation!

SebFelSch
New Member

Hello I would like to change a column which has values 1,2,3,4,5,..., 150,151,152 in 001,002,003,004,005 and so on.

 

I tried it like in Excel with format(text,"000") but it does not work.

 

Anyone an idea?

 

Best wishes,

 

Seb

Duplicate post

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.