Это не окончательное решение, но я надеюсь, что это, тем не менее, перспектива:
Что кажется мне важным в вашем файле, больше, чем столбец «добавлено в метку времени Baket», является продолжением элемента покупки.
Таким образом, каждый раз, когда категория появляется и заменяет другую, должен быть создан новый отдельный индекс.
Я пытался сделать больше в этом направлении, но у меня пока нет полного решения. Я действительно надеюсь, что следующие шаги могут быть полезны, не бесполезны:
AddedIndex = Table.AddIndexColumn(#"Promoted Headers", "Index", 0, 1),
//This adds your index
#"Added Custom" = Table.AddColumn(AddedIndex, "Compare", each if AddedIndex{[Index]}[Product Category] <> AddedIndex{[Index]-1}[Product Category] then "category change" else "same category"),
//This compares the row above in the "Product Category" column and the row below, in order to spot whenever we get a "change" in our sequence.
// I get an error however for my the first row, because an "Index" cannot be negative. I do not know how to solve this issue yet.
#"Added Conditional Column1" = Table.AddColumn(#"Added Custom", "Custom", each if [Compare] = "category change" then 0 else {[Index]+1})
in
#"Added Conditional Column1"
//In this last step I was aiming to either create a "local" index each time there is varaition between "same category" and "category change" or keep adding one but I encounter the following error: "we cannot appliy field acces to the type list"