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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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