Convert TRUE and FALSE into 1 and 0 in Power BI

Here is a simple way how to convert TRUE and FALSE into 1 and 0 in Power BI. Precisely speaking – Power Query and DAX.

Power Query

To convert TRUE and FALSE into 1 and 0 use Number.From.

=Number.From([Values1]=[Values2])

Here are other Power Query posts that might be interesting for you.

DAX

To convert TRUE and FALSE into 1 and 0, use INT function or multiplay with 1.

ToThis = INT('Table'[Values1] = 'Table'[Values2])

Here are other DAX posts that might be interesting for you.

2 comments

  1. But how do you turn the ‘from this’ column to the ‘to this’ column if you don’t have the previous two columns. I’m working with only a true/false column I’d like to convert to numbers.

    1. In the Power Query ensure that the column type is set to “True/False” and use function Number.From to convert that to 1 and 0.
      If the data already loaded in PowerBI, then there is also a data type “True/false” that you can set before applying INT.

Leave a comment

Your email address will not be published. Required fields are marked *

Exit mobile version