Logical.ToText
LogicalConverts a logical value to its text representation.
Syntax
Logical.ToText(logicalValue as nullable logical) as nullable textParameters
| Name | Type | Required | Description |
|---|---|---|---|
logicalValue | logical | Yes | The logical value to convert to text. |
Return Value
text — The text string "true" or "false".
Remarks
Logical.ToText converts true to "true" and false to "false". This is useful when you need to include a logical value in a text concatenation or display a boolean column as human-readable text.
Examples
Example 1: Convert InStock logical to text
Table.TransformColumns(
Table.SelectColumns(Products, {"ProductName", "InStock"}),
{"InStock", each Logical.ToText(_), type text}
)Result
ProductName | InStock | |
|---|---|---|
| 1 | Widget A | true |
| 2 | Gadget B | true |
| 3 | Widget C | false |
| 4 | Gadget D | true |
| 5 | Thingamajig E | false |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks