Forum Discussion

Trailbear's avatar
Trailbear
Microsoft Employee
6 years ago

Boolean converted to Integer on refresh in Service

We have a report with a slicer on a Boolean typed column which publishes as it appears in the desktop app, but changes to an integer type after the data is refreshed in the service. 

The first occurrence of this behavior was noticed on February 12th, 2020.  It persists today February 28th, 2020.

Details and images below. 

 

  1. The slicer appears as desired in the Desktop application 
    1. Values True and False - with True selected by default.
    2. (no type changes when refreshing in the Desktop application)
  2. The slicer appears as desired after initial publish to the service.
    1. Values True and False - with True selected by default. 
  3. The slicer changes unexpectedly after refresh in the service.
    1. After the first refresh the column type unexpectedly changes to an integer type. 
    2. Now showing -1 as selected (True) and the data values are 0 and 1. 

 

The Boolean column "Current Staff" is calculated from a SQL bit column ("Is_Terminated"), using a DAX formula to invert the value.  Snip of the DAX below 

  • #"Added Conditional Column" = Table.AddColumn(#"Renamed Columns", "Current Staff", each if [Is_Terminated] = true then false else true)
  • FYI: We have tried changing case of the true/false values but the desktop editor changes them back to all lower
  • FYI: The SQL column is actually not accurately named... but does show if the person is not found in a specific data source, a nuance that needs to be masked more gracefully in the report)

 

6 Replies

  • This still appears to be an issue today. I have experienced exactly the same behaviour as OP on multiple reports, does anyone have a fix/workaround?

    • OscarHernandez's avatar
      OscarHernandez
      Frequent Visitor

      OwenMITP are you having issues with filters or with measures? 

      If you are having problems with measures, can you please double check if your DAX queries include something like:

      IF([BooleanColumn] = "TRUE", X, Y)
      
      IF([BooleanColumn] = "FALSE", A, B)

       If so, you could change your measures to use the boolean values of said columns instead of their literal value. Following the previous example, you could change your DAX measures to:

      IF([BooleanColumn], X, Y)
      
      IF(NOT([BooleanColumn]), A, B)

       

      • OwenMITP's avatar
        OwenMITP
        New Member

        No issues with Measures, only with columns that show as boolean with values true/false in PBIX and -1/1 when published to powerbi web.

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Trailbear ,

     

    I followed your steps to do the test, but I can't reproduce your issue, please create support ticket .

     

    Best regards,
    Lionel Chen

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

  • I am experiencing the same issue, was this resolved? The Power Query M line that produces the values for this column is as follows:
    Table.AddColumn(#"Filtered Rows1", "CurrentStateView", each if [CurrentState] <> "Inactive" then true else false)

     

    While this works like charm in Power BI Desktop and I can see values like TRUE and FALSE for that column. Even after I publish to the service and visualize, I see the values as TRUE and FALSE. But as soon as the Power BI service refreshes the data set, the values become something like 0 and -1. Strange, still looking for help