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
NewbieJono
Post Patron
Post Patron

Automatically converting To text

hello i am inporting data from a excel spreadsheet, but for some reason it is removing leading 0's

 

e.g in the excel file 25 is 025. how can i stop power query  removing the 0. for some reason it did not remove the 0 from 011!

 

Screenshot 2022-03-08 095940.jpg

1 ACCEPTED SOLUTION
Anand24
Super User
Super User

Hi @NewbieJono ,

It seems like ITT Column was taken as Number datatype by Power Query, hence 0 were removed from beginning.

When converted to text, the 0s were ignored.

You need to remove the part from M Query where ITT is converted to number datatype.

 

Weird behaviour with "011" though.

Can you paste the M Query Code here so that we can look into it?

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

View solution in original post

2 REPLIES 2
watkinnc
Super User
Super User

In the Query Options, uncheck "Automatically detect data types..."

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
Anand24
Super User
Super User

Hi @NewbieJono ,

It seems like ITT Column was taken as Number datatype by Power Query, hence 0 were removed from beginning.

When converted to text, the 0s were ignored.

You need to remove the part from M Query where ITT is converted to number datatype.

 

Weird behaviour with "011" though.

Can you paste the M Query Code here so that we can look into it?

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

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.

Top Solution Authors
Top Kudoed Authors