Forum Discussion
Bottom N giving incorrect result
Hi All,
I have calculated Bottom N dax and used as a slicer. If i enter bottom 5 in slicer it is giving only 4 likewise. Can anyone help me out.
Dax formula : -
Hi Akhil_1411 ,
I am glad that you could find the solution. You can accept your own reply to close this topic.
7 Replies
- mahoneypat
Microsoft Employee
You can try this measure instead
Bottom N Sales = VAR __slicervalue = SELECTEDVALUE ( 'Bottom Sales'[Bottom Sales] ) VAR __topN = TOPN ( __slicervalue, ALL ( Orders[CustomerName] ), CALCULATE ( SUM ( Orders[Sales] ) ), ASC ) RETURN CALCULATE ( SUM ( Order[Sales] ), KEEPFILTERS ( __topN ) )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Akhil_1411
Helper IV
Hi mahoneypat ,
Thanks for your reply😊. The dax which u have given is giving the right result. But, when i apply the Sales amount as a slicer value it is giving the blank result. The Bottom N should also be filtered by the range of sales amount.🤔
Please check my file.
Thanks,
Akhil.
- mahoneypat
Microsoft Employee
Try changing ALL to ALLSELECTED. Please let me know if that doesn't work.
Regards,
Pat