Forum Discussion
Custom column Index or Ranking by other column
- 10 years ago
Thats like an index on a table partition. You can create that by using grouping on the column and returning "_" - which means that all column of the table (but only for the specific value in the column) will be return. You then nest your Index-command in:
let Source = Table1, Partition = Table.Group(Source, {"Group"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}), #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"Date", "Index"}, {"Date", "Index"}) in #"Expanded Partition"
Hi. I'm trying to do something different about the cases exposed.
I have a table that need an increase index when I have some change between three columns. I mean:
| Worker | Fecha | Valor | Index |
| A | 16/04/2018 | TRUE | 1 |
| A | 16/04/2018 | TRUE | 1 |
| A | 16/04/2018 | FALSE | 2 |
| A | 16/04/2018 | TRUE | 3 |
| B | 15/04/2018 | TRUE | 4 |
| B | 16/04/2018 | FALSE | 5 |
| B | 16/04/2018 | TRUE | 6 |
| B | 16/04/2018 | TRUE | 6 |
Starting by 1 in each change of first 3 columns I need to increase the index. I'm trying with all the answer from this post but I can't find the solution.
Other possibility is to save the last combination and the last index in a parameter or another table, but I can't find how to save it in a parameter or table.
In Excel is very easy because yo can calculate from the information in the last cell, but here I can't.
The excel formula could be:
=SI(A2=A1;SI(C2="FALSE";SI(C1="FALSE";E1;E1+1);SI(C1="FALSE";E1+1;E1));E1+1)
Yes, that's possible. No use for the grouping in this case, as your index shall continue to run. The only thing you need here is a reference to your previous row. For performance reasons, I recommend this method: