Forum Discussion
EARLIER function in M/Query Editor
- 8 years ago
HI bullius,
Yes it is possible to do that in M.
To sum up group by your id and add an index.
You can add this code into your steps:
#"Grouped Rows" = Table.Group(#"Promoted Headers", {"ID"}, {{"Count", each Table.AddIndexColumn(_, "Index", 1, 1), type table}})Hope it helps...
Ninter
Hi bullius,
You are absolutely right. You can rank and then pivot the column to achieve what you need.
Here is a sample pbix which showcases this.
Prateek Raina
Thanks prateekraina. My actual dataset is much larger than the example and does not include a Rank field. My question is how do I create one? I would use the EARLIER function in DAX to make sure the ranking restarts with each new ID, but can't find an alternative in M.
- Interkoubess8 years ago
Solution Sage
HI bullius,
Yes it is possible to do that in M.
To sum up group by your id and add an index.
You can add this code into your steps:
#"Grouped Rows" = Table.Group(#"Promoted Headers", {"ID"}, {{"Count", each Table.AddIndexColumn(_, "Index", 1, 1), type table}})Hope it helps...
Ninter
- prateekraina8 years ago
Memorable Member
Hi bullius,
Interkoubess is absolutely right. I haved added his step in the same pbix.
Prateek Raina
- bullius8 years ago
Helper V
Thanks! That works.