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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

PowerBI is Converting TRUE / FALSE to -1/0 on publish

I have a table in a report that contains the following column:-

EscSwitch = SWITCH ( 'RISK_TABLE'[ESCALATE], "TRUE", "YES", "FALSE", "NO" ) where the source data is either TRUE, FALSE or null.
 
Adding this column to a table in PowerBI desktop works as expected, the column is populate with YES, NO or some blanks. However, when i publish, this column works initially, then when the page is refreshed or re-opoened, the fild then shows just blanks.
To investigate i have added the RISK_TABLE'[ESCALATE] field to the table. This returns -1 or 0 instead of TRUE or FALSE as contained in the source data.
Why is the service changing TRUE / FALSE to -1/0 on publish?
Screenshots below
Untitled.png
7 REPLIES 7
martinriddar
Frequent Visitor

Old post I know but I just encountered this myself so I thought that I would link people to the documentation about it.

 

I don't have a reason (since I think the behaviour is bollocks, especially when it differs between desktop and service) but it is documented here: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-types#truefalse-type

Basically, as my understanding goes, any text column that contains values that can be converted to logical true/false will be converted when doing a refresh in the service (not on desktop) and logical true is represented as -1, same as in the language Forth and some others... I'll refer to the answers in this Stack Overflow thread for the reasoning behind this representation:
https://stackoverflow.com/questions/23832703/why-does-forth-return-1-as-a-flag-for-true

Anonymous
Not applicable

I encountered the exact same scenario.  My published reports would look fine if I refreshed data using desktop version and then published online.  However, if dataset is refreshed online (manually or scheduled), then the visuals returned with Blank results.  Here's my solution that seems to be working.  Using desktop version,

  1. In Power Query, change the column type to True/False (see screenshot below).
  2. Close and apply.
  3. In each visual, remove any existing use of the original column and replace it with the revised column.
    1. Not sure why I had to do this, but I did.
  4. Save and publish.
  5. Look at report online and it looks fine now.
    1. I tested by refreshing dataset again, but using PowerBI online.
    2. Reports look fine still.

I can't explain why PowerBI is converting the values (doesn't make sense to me!) and I can't explain why my solution is working either, but it is.  I'm going back to my other datasets and applying this solution.  From now on, I will edit all columns containing True/False to use the True/False column type.  Hope this helps!

elallen_0-1663944757092.png

 

Anonymous
Not applicable

Any resolution to this? I'm having this problem and it's breaking my reports daily. There was no issue for about a month and it started all of a sudden.

Anonymous
Not applicable

Checkout my reply posted today... I think it fixed my issue.

AbhiSSRS
Solution Sage
Solution Sage

This issue still persists in service and is not fixed 

v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Sorry for that, but we cannot reproduce your issue on my side, What is the kind of connection you are using, import or directquery?2.jpg3.jpg4.jpg5.jpg6.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi, this is Microsofr Project Online data accessed by odata.

URL used is https://XXX.sharepoint.com/sites/ppm/_api/Projectdata

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Users online (3,224)