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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
mauropasi
Advocate I
Advocate I

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

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

3 REPLIES 3
mauropasi
Advocate I
Advocate I

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.

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.

How i can running that code?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.