Power Query – Adding Leading Zero to Number (EG: Month Number)

Below is an example if you have a requirement and you want to add a leading zero

Example: You have a Month Number that starts with “1”, and you want it to start with “01”

  1. In your Power Query Window, click on Add Custom Column and then put in the following syntax

    Text.PadStart(Text.From([Month]),2,”0″)

    1. NOTE: In the above example, we have our column name as Month
  2. So once completed it will look like the following:
Advertisements

2 thoughts on “Power Query – Adding Leading Zero to Number (EG: Month Number)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s