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.
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
Solved! Go to Solution.
@RickHantz, try disabling the two highlighted items in below image:
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.
I know this is from years ago, but just adding an alternate solution.
Rather than trying to prevent PowerBI from changing the type, let it change it as per default. Then go into Query Editor, and change the type for the one column for which you wish to change the type. It is probably easier to add this one step rather than to manually set the data type for multiple columns.
If you want to "intercept" this when you're first loading the data, click on "Transform data" to go straight to the Query Editor before the data gets loaded.
this is on your topic:
@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.
There is one to turn off auto date conversions, but not for EE.
@RickHantz, try disabling the two highlighted items in below image:
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.
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
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.
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.
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?
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |