cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

"How to prevent Power BI from converting text data?"

We have data with lots of product codes that get auto converted to dates or scientific notation.

To prevent the conversion, we import the csv files as text to excel and save as xlsm.

However, Power BI still auto converts them into nonsense.

Are we missing a setting or technique to prevent the auto conversion?

 

thanks,

 

RickH

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Re: "How to prevent Power BI from converting text data?"

@RickHantz, try disabling the two highlighted items in below image:

 

pic.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Otherwise, try the following:

 

When you load data into Power BI Desktop instead of clicking "Load", click "Edit" instead (which opens the Query Editor) and remove all steps after the "Source" or "Navigation" step (depending on if it's Excel or CSV, since Excel can have multiple sheets ,"Navigation" would be required to select the appropriate sheet whereas CSV's are only one sheet). By doing this, you will retain the source data without any modifications being done by Power BI automatically.

 

View solution in original post

10 REPLIES 10
Highlighted
Memorable Member
Memorable Member

Re: "How to prevent Power BI from converting text data?"

since you say Date or Scientific Notation : I am wondering when you look at the table data view's field type - what is it saying?

 

also in Query Editor;  if the field type is not saying 'text' - and you change it to text - does the display correct itself?

 

www.CahabaData.com
Highlighted
Continued Contributor
Continued Contributor

Re: "How to prevent Power BI from converting text data?"

@RickHantz I don't have access to Power BI right now, but isn't there an option under File -> Options -> Options -> Data Load about performing implicit transformations when loading data into Power BI?

 

I know there was an option about auto detecting relationships, there should be something similar for transformations.

Highlighted
New Member

Re: "How to prevent Power BI from converting text data?"

No, once its converted from text to a date or number, the original data is lost.

Opening the spreadsheet in Power BI converts it; it’s too late to change the column types.

 

(In the news, the gene research community has been bit by this Excel auto conversion, corrupting data published as Excel spreadsheets.)

 

I was thinking of adding an apostrophe by macro to all the data in columns that are affected. Going to try that next.

 

-RickH

 

 

Highlighted
New Member

Re: "How to prevent Power BI from converting text data?"

There is one to turn off auto date conversions, but not for EE.

Highlighted
Continued Contributor
Continued Contributor

Re: "How to prevent Power BI from converting text data?"

@RickHantz, try disabling the two highlighted items in below image:

 

pic.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Otherwise, try the following:

 

When you load data into Power BI Desktop instead of clicking "Load", click "Edit" instead (which opens the Query Editor) and remove all steps after the "Source" or "Navigation" step (depending on if it's Excel or CSV, since Excel can have multiple sheets ,"Navigation" would be required to select the appropriate sheet whereas CSV's are only one sheet). By doing this, you will retain the source data without any modifications being done by Power BI automatically.

 

View solution in original post

Highlighted
New Member

Re: "How to prevent Power BI from converting text data?"

That seems to work, but now I need to manually specify row1 is the header row. How do I do that?

Editing the query lets me specify the two non-text columns as number, but I don't see how to specify the header row.

 

thanks for the help,

 

-RickH

Highlighted
Memorable Member
Memorable Member

Re: "How to prevent Power BI from converting text data?"

Highlighted
New Member

Re: "How to prevent Power BI from converting text data?"

Ok, I manually specified the header row, that works.

Then I edited the query for the two columns that have integers in them from text to number.

I now get an error saying it can't convert from text to number. We need to be able to sum those columns.

Highlighted
Continued Contributor
Continued Contributor

Re: "How to prevent Power BI from converting text data?"

@RickHantz

 

Can you provide some sample data, specifically what you start out with and what you want to end up with?

 

If the value you have in text form is just a bunch of numbers (digits), then there shouldn't be a reason as to why the conversion would fail.

 

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors