Forum Discussion
Newbie question: Top Selling Products by Customer Current Year and Previous Year
Hello, i'm trying to build the attached table containing Customer Name and Top 2 Selling Products each by Current Year and Previous Year.
I have no issues when i use only current year sales. Table shows precisely Customer name and 2 top selling products each but when i add Previous Year sales, Table shows more products than defined by RANK limit (Less than 3) as shown in the attached picture.
Could anyone give me a tip on how to solve it?
Thanks in advance,
Alex-
Hi arlequin71,
Have you used rankx() function in DAX? Do you want to achieve top2 sales every year or all years? Could you show the measure or calculate column you are using and provide more details?
Regards,
Jimmy Tao
2 Replies
- v-yuta-msft
Community Support
Hi arlequin71,
Have you used rankx() function in DAX? Do you want to achieve top2 sales every year or all years? Could you show the measure or calculate column you are using and provide more details?
Regards,
Jimmy Tao
- arlequin71
Helper II
Hello, i solve it including an IF statement for previuos column. Then if there is no data, current column stop adding values.
Thanks for your help.