Percentage.From
A value as a percentage number (Percentage.Type): 12.5 % is 0.125.
Group: Values, types and errors. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Percentage.From(value as any, optional culture as nullable text) as nullable number
| Parameter | Type | Description |
|---|---|---|
value | any | The value to convert: a number, text, a logical, a date, datetime, time or duration; null gives null. |
culture | nullable text optional | The culture text is read in, such as "nb-NO"; the query's culture when left out. |
Returns
nullable number. The number; null for null.
Remarks
- Text with a trailing % is divided by 100; a number is kept as it is.
Examples
Text with a per cent sign
Percentage.From("12.5%")
0.125
A number is already a fraction
Percentage.From(0.25)
0.25