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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
WJ876400
Helper IV
Helper IV

Leading zero

Hi

 

I have a list of ID numbers and some of them are missing a leading zero, the ID number should be 8 digits long the IDs that need a leading zero are only 7 digits long. How do I add a leading zero to just the 7 digit IDs in the query editor?

 

thanks in advance

1 ACCEPTED SOLUTION

@WJ876400 , use only one second is alternate

example

 

Text.PadStart(Text.From([Colum]),8,"0")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @WJ876400 ,

Has your problem been solved by @amitchandak 's solution? If yes, please consider accept it as the solution to help the other members find it more quickly.

Best Regards,
Community Support Team _ kalyj

WJ876400
Helper IV
Helper IV

Hi @amitchandak  thank you for the quick response. I get an error on the custome column

 

WJ876400_0-1641554637669.png

 

@WJ876400 , use only one second is alternate

example

 

Text.PadStart(Text.From([Colum]),8,"0")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@WJ876400 , In power query

Text.PadStart(Text.From([Colum]),8,"0")

Text.PadStart([Colum],8,"0")

 

DAX

format([Column], "00000000")

 

https://www.fourmoo.com/2015/03/25/power-query-adding-leading-zero-to-number-eg-month-number/

https://gorilla.bi/power-query/add-leading-zeros/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.