Logical.From

Logical.From is a Power Query M function that converts a given value to a logical value, handling null values, text, and numbers. The function returns the converted logical value, or an error if the input value cannot be converted.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Logical.From( value as any ) as nullable logical

Description

Returns a logical value from the given value. If the given value is null, Logical.From returns null. If the given value is logical, value is returned. Values of the following types can be converted to a logical value:

  • text: A logical value from the text value, either "true" or "false". Refer to Logical.FromText for details.
  • number: false if value equals 0, true otherwise.
If value is of any other type, an error is returned.

Examples

Convert 2 to a logical value.

// Output: true
Logical.From( 2 )

Other functions related to Logical.From are:

BI Gorilla Blog

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/logical-from
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.