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 us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.
User | Count |
---|---|
442 | |
146 | |
122 | |
52 | |
51 |
User | Count |
---|---|
447 | |
131 | |
117 | |
79 | |
70 |