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" )
Related functions
Other functions related to Logical.FromText are:
