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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ovonel
Post Prodigy
Post Prodigy

how to force integers into text (they are codes)

I have some data from excel. There is a column which are codes, most of them just numeric but come are alphanumeric.

 

When in excel I see the message “the number in this cell is formatted as text or preceded by an apostrophe”

 

When I open it in powerbi, I consume the file…. I go to “transform data” (instead of load).

 

Then I go to the said column and when I want to change the datatype to text, I get:

 

del.jpg

 

(I have tried both options, and with both options I end up with “errors”).

 

What is the correct way for forcing even a column that is just numbers into text? ( they are codes, so no intention of using them as numbers)

 

 

2 REPLIES 2
v-xiaoyan-msft
Community Support
Community Support

Hi@ovonel,

 

I notice that there is the message “the number in this cell is formatted as text or preceded by an apostrophe” in excel before you connect to Power BI Desktop.

You can handle this problem first ,  then try it again in Power BI Desktop.

Here's the workround :You cannot convert text to number when the cell contains a number 

 

Hope it helps.

Best Regards,
Caitlyn Yan

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

PaulDBrown
Community Champion
Community Champion

@ovonel 

You are getting this message because Power Query "automatically" assigns a field type when the query is loaded. Check in the query steps, locate the first "Changed Type" step and edit the rogue column to tye text





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.