Hi everyone. I need assistance with a topic.
I have the following collumn of Order ID and Product:
Order ID | Product |
001 | Apple |
002 | Apple |
003 | Banana |
004 | Banana |
005 | Pear |
006 | Apple |
I'm trying to create a column in which i have a list, like:
Order ID | Product | Order of the Item |
001 | Apple | 1 |
002 | Apple | 2 |
003 | Banana | 1 |
004 | Banana | 2 |
005 | Pear | 1 |
006 | Apple | 3 |
I wanna know which order of each product it was, as in "the order ID 006 was the third time an Apple was ordered".
Thanks.
Solved! Go to Solution.
Hi @Quartarolo ,
Check the attached file.
Another approach only using lists:
let
_product = [Product],
_order = [Order ID]
in
List.Count(
List.Select(
List.FirstN(#"Sorted Rows"[Product], _order),
each _ = _product))
Hi @Quartarolo ,
Check the attached file.
Another approach only using lists:
let
_product = [Product],
_order = [Order ID]
in
List.Count(
List.Select(
List.FirstN(#"Sorted Rows"[Product], _order),
each _ = _product))
Thank you very much!
It worked perfectly!!
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
454 | |
169 | |
119 | |
55 | |
51 |
User | Count |
---|---|
454 | |
147 | |
131 | |
73 | |
72 |