Forum Discussion
Getting Rank Order by Group, then ungroup
- 3 years ago
Hi pbi_throw_away,
You can use Projection (or select columns) to only keep the Custom column with additional logic
Projection will look like this:
Table.AddColumn(#"Group by CustomerID", "Custom", each Table.AddRankColumn([AllData], "SaleRank", {"SaleDateTime", Order.Ascending}, [RankKind = RankKing.Ordinal] ))[[Custom]]After the closing parenthesis for the Table.AddColumn function, in a set of square brackets (for projection) you select a column [Custom] (that also requires square brackets). Alternatively using the ribbon you can "Select Columns" OR "Remove other columns" as well, of course.
Finally use the expand column option (sideward arrows in the column header) to bring back all fields including the newly added rank from Custom.
Ps. Please mark this answer as solution when it helped you to resolve your question, thanks!
Hi pbi_throw_away,
You can use Projection (or select columns) to only keep the Custom column with additional logic
Projection will look like this:
Table.AddColumn(#"Group by CustomerID", "Custom", each Table.AddRankColumn([AllData],
"SaleRank",
{"SaleDateTime", Order.Ascending},
[RankKind = RankKing.Ordinal]
))[[Custom]]
After the closing parenthesis for the Table.AddColumn function, in a set of square brackets (for projection) you select a column [Custom] (that also requires square brackets). Alternatively using the ribbon you can "Select Columns" OR "Remove other columns" as well, of course.
Finally use the expand column option (sideward arrows in the column header) to bring back all fields including the newly added rank from Custom.
Ps. Please mark this answer as solution when it helped you to resolve your question, thanks!