Percentage.From

Updated on

Percentage.From is a Power Query M function that converts a given value to a percentage. The function returns the percentage value as a number, considering an optional culture.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Percentage.From(
   value as any,
   optional culture as nullable text,
) as nullable number
Argument Attribute Description
value
culture optional The culture argument enables the specification of a Culture code (e.g., “nl-NL” or “en-US”) to align transformations with local formatting conventions. If this argument is omitted, functions default to Culture.Current, which reflects the system’s regional settings.

Description

Returns a percentage value from the given value. If the given value is null, Percentage.From returns null. If the given value is text with a trailing percent symbol, then the converted decimal number will be returned. Otherwise, the value will be converted to a number using Number.From. An optional culture may also be provided (for example, “en-US”).

Examples

Get the percentage value of "12.3%".

// Output: 0.123
Percentage.From( "12.3%" )

Other functions related to Percentage.From are:

BI Gorilla Blog

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