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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Frenk_UM
New Member

transforming 1 to 001

I have a column with different numerical values.

 

For example

1

2

 

10

100

 

I want to realise that al numirical values exist of 3 numbers, so it becomes:

1 becomes 001

2 becomes 002

10 becomes 010

100 stays 100

 

Whats the formula behind this

1 ACCEPTED SOLUTION
barritown
Super User
Super User

Hi @Frenk_UM,

You could do it with this line via DAX:

barritown_0-1704800516967.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

2 REPLIES 2
barritown
Super User
Super User

Hi @Frenk_UM,

You could do it with this line via DAX:

barritown_0-1704800516967.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

zenisekd
Super User
Super User

In Power Query add a conditional column B, with the following condition:
if Column A <9 then 00,
if Column A < 99 then 0
else null.

Next, you merge the newly created column B with the created column A.

Kudos and mark as solution appreciated.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.