Order.Ascending (0) is an enumeration that specifies the direction of sorting. It is a member of the Order.Type and indicates that values should be sorted in ascending order.
Examples
You can apply sorting criteria to the List.Sort function.
// Below statements return { 1, 2, 3 }
= List.Sort( { 2, 3, 1 } )
= List.Sort( { 2, 3, 1 }, 0 )
= List.Sort( { 2, 3, 1 }, Order.Ascending )
When you have a table called Source with the column Date, the following code sorts the table by date.
= Table.Sort(
Source,
{ "Date", Order.Ascending }
)
= Table.Sort(
Source,
{ "Date", 0 }
)
Similarly, the Table.AddRankColumn function can make use of the Order.Ascending sorting type to specify how to rank a column.
= Table.AddRankColumn(
Source,
"Rank",
{"Data Type", Order.Descending }
)
Related articles
Learn more about Order.Ascending in the following articles:
- Mastering List.Sort in Power Query M: Comprehensive Guide
Learn to master the List.Sort function in Power Query. Create custom sort orders using the comparison criteria for advanced data sorting, beyond the basics. » Read more
Related enumerations
Other related enumerations are:
Applies to
Here’s a list of functions that work with Order.Type:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy