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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

after data refresh all data types turned into Text

Hi, 

I took over a dashboard (.pbix) file from a collaborator. First thing I wanted to do is refresh the data (through an Athena ODBC connection) using the refresh button in my Power BI desktop environment. All data types where set from the Data View Mode and before refreshing everything looks fine e.g. number of decimales, % types, etc. 

After refreshing most visuals were broken with Error Message: 'Something's wrong with one or more fields:...'. While checking Data Types all previously set were truned into Text when viewing in Data View > Modeling. 

Any ideas suggestions?

Cheers, 

Maarten

 

5 REPLIES 5
lbieber
New Member

This randomly happens to us.  A column will say "Whole Number," then we click Refresh, and things break because the column is now type Text.  We have not been able to determine the cause.  Of course, we checked the data type in the source database as well.  Any ideas how to avoid this in the future?

amitchandak
Super User
Super User

@Anonymous , You need to figure out why data type has changed.

Open Data Transformation and Edit Query mode.  Change Data type there. In case there is some error look for the error row and correct it.

 

refer to this for that https://www.youtube.com/watch?v=9-Lag0VOiTs

Anonymous
Not applicable

@AllisonKennedy  and @amitchandak Thanks for the quick replies! 

 

After refresh I can change data types without any errors occuring (but there several tables and many columns:))! Actually another collaborator can refresh without errors. Can it be that there are Settings that introduce this behaviour? I checked File> Options > Local File > Data Load with and without automatic Data Type detection but both same error.

@Anonymous are you and collaborator both using the same version of the report and the same version of power bi desktop?

Can you please confirm that you are changing data types using M in Power Query, not just in the Data View? Using M is a more reliable way to change the data type and will force the conversion to number even if there is text, but will return an error.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

AllisonKennedy
Super User
Super User

I would recommend setting the data type in the Query Editor, NOT in the data view:
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-data-types

 

That will ensure that data type is set properly upon refresh.

 

If you're still having trouble with the refresh or there are errors in the Query Editor, please share your M code from Advanced Editor if able


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors