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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
benqpbi
Helper I
Helper I

How to add value in column which is not consistent

I have a column named task name which is incosistent but i want to add zero before my 1,2 and so on... how do i add in power query/ m-code so it is future proof

 

1 ACCEPTED SOLUTION
Jayee
Responsive Resident
Responsive Resident

Check this document from Microsoft it is very simple in terms of steps you need to follow.

 

https://learn.microsoft.com/en-us/power-query/column-from-example

 

 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

View solution in original post

7 REPLIES 7
ryan_mayu
Super User
Super User

@benqpbi 

what's the expected output?

_PRODUCT_gg_SEQ01 or 01?

What if for those numbers are two digits, do you still want to add 0?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Jayee
Responsive Resident
Responsive Resident

Hi @benqpbi 

 

Use Column from examples transformation in power query and provide some examples in the column highlited then power query will write M code automatically.

 

I can able to sort with the data you have provided

Jayee_0-1669181472022.png

 

 

Here the link for same file

 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

sorry i dont get it how 

Jayee
Responsive Resident
Responsive Resident

Check this document from Microsoft it is very simple in terms of steps you need to follow.

 

https://learn.microsoft.com/en-us/power-query/column-from-example

 

 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

hey jay thanks just tried but it creates a if else statement which is not possible since when new data comes it might be wrong, any other solution if possible

Jayee
Responsive Resident
Responsive Resident

Have you check the sameple file provided in first reply!

 

please check here the link again

Jayee
Responsive Resident
Responsive Resident

Nope it will do the same transformation for all the new data as well you need to give the data correctly for couple of examples to make power query to understand.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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