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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sandromarani
New Member

Boolean field shows different value on web from desktop

When I create a boolean field on the desktop, it returns true or false. On the web it shows 0 and -1

These are fields in the calendar using functions of current year, current month

1 ACCEPTED SOLUTION

but my field created in M, I modified it this way

 = Table.AddColumn(ProximoDia, "mesatual", each if Date.IsInCurrentMonth([DataBase]) then 1 else 0)

View solution in original post

2 REPLIES 2
nabandla
Helper I
Helper I

The difference in the boolean field representation between Power BI Desktop and the Power BI web service is due to how the two platforms handle boolean values. In Power BI Desktop, boolean values are represented as "True" and "False," while in the Power BI web service, they are represented as numeric values of 1 and 0 (or -1 in some cases).

To ensure consistency in the representation of boolean fields across both Power BI Desktop and the web service, you can use the DAX function `IF` to explicitly convert the boolean expression to numeric values.

Here's an example of how you can use the `IF` function to convert a boolean field to numeric values in Power BI Desktop:

```dax
NumericField = IF('Table'[BooleanField], 1, 0)
```

In this example, `'Table'[BooleanField]` represents your boolean field. If the boolean field is true, the `IF` function will return 1; otherwise, it will return 0.

By using this formula to create a new calculated column or measure in Power BI Desktop, you can ensure that the boolean field is represented consistently as numeric values of 1 and 0 across both Power BI Desktop and the Power BI web service.

Please note that when you create a boolean field directly in the Power BI web service using functions like `current year` and `current month`, the representation of true and false as 0 and -1 is the default behavior. Using the `IF` function as described above can help maintain consistency with Power BI Desktop.

but my field created in M, I modified it this way

 = Table.AddColumn(ProximoDia, "mesatual", each if Date.IsInCurrentMonth([DataBase]) then 1 else 0)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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