Logical.FromText

Logical.FromText is a Power Query M function that creates a logical value from a case-insensitive text value, either “true” or “false”. The function returns the created logical value or throws an exception if the text contains a different string.

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

Syntax

Logical.FromText( text as nullable text ) as nullable logical

Description

Creates a logical value from the text value text, either “true” or “false”. If text contains a different string, an exception is thrown. The text value text is case insensitive.

Examples

Create a logical value from the text string “true”.

// Output: true
Logical.FromText( "true" )

Create a logical value from the text string “a”.

// Output: [Expression.Error] Could not convert to a logical.
Logical.FromText( "a" )

Other functions related to Logical.FromText 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-fromtext
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.