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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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