cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JacktheYeti Frequent Visitor
Frequent Visitor

PowerBI Data Types

Hello,

 

I'm importing data from a mySQL database to run some reports on. There is a column that repsents the coupon type and is identified by a number 1 - 5.

 

When the data is loaded into PowerBI, it categorizes this column as a Boolean, specifically True, vs. the whole number it actually is. 

 

When I query the Database outside of PowerBI I can see each of the whol enumbers appropriately (1 -5).

Is there a way I can load this datatype specifically before PowerBI Transforms it automatically for me?

1 ACCEPTED SOLUTION

Accepted Solutions
JacktheYeti Frequent Visitor
Frequent Visitor

Re: PowerBI Data Types

The column causing trouble was type TINYINT inside the database. I created a new datasource and wrote a SQL statement that used the CAST() function to change the type and load it into PowerBI successfully. 

 

For reference, it looked like this: 

CAST(coupon.type AS SIGNED) as coupon_Type

 

View solution in original post

5 REPLIES 5
HotChilli New Contributor
New Contributor

Re: PowerBI Data Types

When you look at the data in Power Query, you should be able to edit or delete the step that wrongly identifies the column as a bool.

Highlighted
Community Support Team
Community Support Team

Re: PowerBI Data Types

Hi @JacktheYeti ,

 

Method 1:

Go to File->Options and settings-> Options, disable the type detection option like picture below (disable the option will affect all fields' type detection, so do this carefully).38.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Method 2:

Change the data type in Report view or Data view .39.png

 

 

 

 

 

Method 3:

Enter into Query Editor, delete the step named "Changed Type", or change the data type.

40.png

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

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

JacktheYeti Frequent Visitor
Frequent Visitor

Re: PowerBI Data Types

It happens upon initial data load, so it seems there is no step to delete or change. I've tried changing it post load but the BOOL becomes a 1 or 0 when I change it to a whole number type.

JacktheYeti Frequent Visitor
Frequent Visitor

Re: PowerBI Data Types

The column causing trouble was type TINYINT inside the database. I created a new datasource and wrote a SQL statement that used the CAST() function to change the type and load it into PowerBI successfully. 

 

For reference, it looked like this: 

CAST(coupon.type AS SIGNED) as coupon_Type

 

View solution in original post

JacktheYeti Frequent Visitor
Frequent Visitor

Re: PowerBI Data Types

Thanks Amy, I gave this a try but was unsuccessful. The data would load in as TRUE and FALSE or 1 and 0.

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)