Updated on

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


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


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.


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:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/logical-fromtext