Percentage.From
NumberConverts a value to a percentage number type.
Syntax
Percentage.From(value as any, optional culture as nullable text) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
value | any | Yes | The value to convert. Accepts number, text, logical, or null. |
culture | text | No | An optional culture string for locale-aware parsing of text values. |
Return Value
number — A number typed as a percentage.
Remarks
Percentage.From converts a value to the percentage data type. The underlying numeric value is stored as a standard decimal — 0.25 represents 25%, 1.0 represents 100%. The percentage type is primarily a display annotation: it signals to the host application (such as Power BI Desktop) that values should be formatted with a % suffix and scaled appropriately in visuals and data labels. The raw stored value does not change.
This distinction is important: if you have a column where 25 should represent 25%, you must first divide by 100 and then apply Percentage.From. If you have a column already storing 0.25 for 25%, you can apply Percentage.From directly. The function does not perform any scaling — it only changes the type annotation.
When converting from text, behavior depends on the environment: some locales recognize "25%" as 0.25, while others treat it as 25. To avoid ambiguity, normalize text percentages to decimal form before converting. Logical true converts to 1 (100%), false to 0, and null returns null. To apply percentage type to an entire column, use Table.TransformColumnTypes with Percentage.Type.
Examples
Example 1: Annotate a ratio as percentage type
Percentage.From(0.25)Result | |
|---|---|
| 1 | 0.25 |
Example 2: Parse a decimal text string as percentage
Percentage.From("0.75")Result | |
|---|---|
| 1 | 0.75 |
Example 3: Compute market share and annotate as percentage
let
TotalQty = List.Sum(Sales[Quantity]),
WithShare = Table.AddColumn(
Table.SelectColumns(Table.FirstN(Sales, 4), {"OrderID", "CustomerName", "Quantity"}),
"MarketShare",
each Percentage.From([Quantity] / TotalQty),
Percentage.Type
)
in
WithShareThe final output — the four-column table showing each order's ID, customer, quantity, and percentage share of total quantity.
OrderID | CustomerName | Quantity | MarketShare | |
|---|---|---|---|---|
| 1 | 1 | Alice | 4 | 0.17 |
| 2 | 2 | Bob | 2 | 0.09 |
| 3 | 3 | Charlie | 10 | 0.43 |
| 4 | 4 | Alice | 1 | 0.04 |