Forum Discussion

o59393's avatar
o59393
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Add leading zeros to text in Power Query

Hi all

 

I need to replicate the following excel formula in power query:

 

 

Here is my power query column:

 

I tried:

 

 

 

Error came in:

 

 

 

 

How can i fix it?

 

Thanks.

3 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Icon for Community Champion rankCommunity Champion

     

    Text.PadStart([#"[BPP CODE]"], 10, "0")

     

  • The data is already in the correct format. Just change column type to text so that the leading zeros are not removed upon load.

    Table.TransformColumnTypes(Source,{"BPP Code", type text})