Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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!!
User | Count |
---|---|
103 | |
91 | |
79 | |
72 | |
68 |
User | Count |
---|---|
108 | |
96 | |
95 | |
73 | |
71 |