Value.Compare is a Power Query M function that compares two input values and returns -1, 0, or 1 based on whether the first value is less than, equal to, or greater than the second one. The function returns an integer indicating the comparison result between the two input values.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
value1 as any,
value2 as any,
optional precision as nullable number,
) as number
|The Precision.Type specifies the accuracy level for calculations. When omitting this argument, Power Query uses Precision.Double by default, which, while efficient, may cause rounding errors with very small fractions. For greater accuracy Precision.Decimal offers a more precise number representation, ideal for tasks requiring high precision.