Forum Discussion
Top 3 values in a row in Table
the answer is fundamentally yes - there is a TopN and a Rank function in DAX and also in visual filtering and so there is more than 1 way to construct this.
In your raw data you show product values side-by-side while in your goal they are stacked. And so there is an unpivot task to perform.
It wasn't quite clear as to whether you sought top 3 sales person or top 3 product - - or maybe both.....
- charmainer9 years ago
Helper III
Thanks for your reply.
I need the Top 3 Products sold for every sales Person.
I do not know dax too well though so any suggestions would help.
Kind Regards,
Charmaine
- erik_tarnvik9 years ago
Solution Specialist
My advise would be to use the Query Editor to reshape the data in a format that makes it much easier to achieve your objective. Instead of:
Name Product 1 Product 2 Salesman 1 200 300 Salesman 2 20 450
you would want:
Name Product Amount Salesman 1 Product 1 200
Salesman 1 Product 2 300
Salesman 2 Product 1 20
Salesman 2 Product 2 450You can use "Unpivot Column" functionality in the Query editor to achieve this. Once you have the data in this format you can use the DAX TOPN function.
- charmainer9 years ago
Helper III
Hi Thanks for that.
I have tried to unpivot ... but i have duplicate values in the real data ( i have just given you a sample) .
Will get back to you with what i have come back with. i might change the real data and upload it to see how to over come the dupliecat values.
Kind Regards
Charmaine