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,
With data exactly as shown by fedpar in his original post dated 05-07-2016, the following code provided by you is not working
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"When i paste that code in the New Query window of Power Query, i get an error message
Expression.Error: A cyclic reference was encountered during evaluation.
Please help.
Hi Ashish_Mathur,
it works for me. You might not have applied the code correctly or have other queries in your current file with name conflicts that cause this message. Please have a look at this video - there I've worked with exactly the same data and used the query you've mentioned: https://youtu.be/S9xlq5KUZ60
- Ashish_Mathur9 years agoSuper User
Hi,
It is working absolutely fine now. Thank you very much.