March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 : -
Solved! Go to Solution.
Hi @Akhil_1411 ,
I am glad that you could find the solution. You can accept your own reply to close this topic.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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.
Try changing ALL to ALLSELECTED. Please let me know if that doesn't work.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Ok. VALUES( ) around Customer Name instead of ALL( ) should do it.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
It is not working with Values(). But, thanks for your time.😊
I have re-written the dax now it is giving the expected result.
Bottom Sales = var A = RANKX(ALLSELECTED(Orders[Customer Name]),CALCULATE(SUM(Orders[Sales])),,ASC,Dense) return IF(ISFILTERED(Orders[sales customer]),IF(A<=SELECTEDVALUE('Bottom Sales'[Bottom Sales])+1,SUM(Orders[Sales]),BLANK()),IF(A<=SELECTEDVALUE('Bottom Sales'[Bottom Sales]),SUM(Orders[Sales]),BLANK()) ) |
Hi @Akhil_1411 ,
I am glad that you could find the solution. You can accept your own reply to close this topic.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |