cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mauropasi Regular Visitor
Regular Visitor

int being cast to boolean and incorrectly transformed back to int

Hi everybody. 

I am connecting to an MySQL database and I have a column being picked up by Power BI as boolean even though it is int.

I know that this happens because power query is only looking at the first x (200?) rows of data.

What I have always done to fix this is just transforming the type to int but for some reason is doesn't seem to fix it this time. I only get 0s and 1s. It's like it is actually converting the values instead of folding the query correctly and getting them as int in the first place.

If I force the type casting with cast() in the SQL query it works for me but then I introduce a block for following query foldings which I am not sure it is what I want to do.

Is there any way to force power bi to look at more rows or to make sure that the transformation is successful.

1 ACCEPTED SOLUTION

Accepted Solutions
mauropasi Regular Visitor
Regular Visitor

Re: int being cast to boolean and incorrectly transformed back to int

There is a 

TreatTinyAsBoolean = false

which seems to be what I am looking for. I just need to figure out how to use it and what effects it will have on query folding.

View solution in original post

2 REPLIES 2
mauropasi Regular Visitor
Regular Visitor

Re: int being cast to boolean and incorrectly transformed back to int

it may have something to do with the schema being wrong in the first place but I would still like to do something about it.

mauropasi Regular Visitor
Regular Visitor

Re: int being cast to boolean and incorrectly transformed back to int

There is a 

TreatTinyAsBoolean = false

which seems to be what I am looking for. I just need to figure out how to use it and what effects it will have on query folding.

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 376 members 3,575 guests
Please welcome our newest community members: