Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |