September 8, 2022

How can we Pad 0 to Integer Values in Power BI?

Overview:

Sometimes we have a requirement, where we need to Pad “0” to our numeric value. There are multiple ways to implement this. But we will go with the simplest and easiest one! So, let’s get started!

Step 1:

This is our Sample Data Source, where we have Project ID, Project Name, and Hours column.

Now, we want to pad “0” before our Project ID column and need the end outcome like the following. So, how can we achieve this?

Step 2:

 - Open Model View of Power BI Desktop and select the “Project ID” column.
 - From Format, select “Custom”.
 - Under Custom Format provide, format as “00#” – This will suggest, from a 3-digit number, it will pad leading digits with “0”. 

Example: If the number is 9, it will show as “009”. If the number is 19 then it will show as “019”. This will show us the end outcome as below screen!

Conclusion:

This is how we can simply pad leading “0” before the number in Power BI. Isn’t that cool? Happy Reporting!

If you have any questions you can reach out our SharePoint Consulting team here.

No comments:

Post a Comment