SORT

The SORT function accepts a series of values and returns an array of values sorted in ascending order. It is commonly used to arrange numeric data for comparison, ranking, and analytical calculations. Since the function returns an array, individual elements can be accessed using their index positions.

To sort in descending order use the SORTDESC function.

Syntax

SORT(value1, [value2], ...)

Arguments

  • value1: The first value to sort.
  • value2, ... (Optional): Additional values to include in the sorting operation.

Return value

Returns an array of values sorted in ascending order.

Example

Consider a scenario where quarterly actuals values need to be analyzed to identify the lowest and second-lowest actuals amounts. The SORT function can be used to sort the quarterly actuals values for each row in ascending order.

In this example, the variable a stores the array returned by the SORT function. The lowest quarterly revenue can then be accessed using a[0], while the highest quarterly revenue can be accessed using a[3].

Excel equivalent

SORT

Fabric Plan
Enterprise planning, integrated with PowerTable and Intelligence, native to Microsoft Fabric. Co-engineered with Lumel.
CERTIFIED BY
Fabric Planning is certified by IBCS
Microsoft, Azure, Copilot, Excel, Fabric IQ, Microsoft Entra, Microsoft Fabric, Microsoft Teams, OneLake, Outlook, Power Automate, Power BI and SharePoint are trademarks of the Microsoft group of companies. IBCS is a registered trademark of IBCS Association. All other trademarks are the property of their respective owners.

This community is operated independently by Lumel. Nothing on this site constitutes a representation or warranty by Microsoft.