Forum Discussion
Jayasimha
5 years agoFrequent Visitor
Dynamic Rank in table based on multiple columns and one value
Hi Experts, PowerBI I have created a table with multiple columns and one value field. I need to create a dynamic rank as there are some slicers available. The rank should be dynamic and change bas...
amitchandak
5 years agoSuper User
Jayasimha , what is formula /measure you have used. Typically rank like this should use filters
RANKX(allselected(Geography[City]),[Sales])
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415
Jayasimha
5 years agoFrequent Visitor
Hi amitchandak ,
Thank you for getting back. Below is my measure.
rankforrows = RANKX(ALLSELECTED(Data),CALCULATE(SUM(Data[Sales]),ALLEXCEPT(Data,Data[Region],Data[Month],Data[Source],Data[Client],Data[Service],Data[Sub Service],Data[Product]),Data[Product])),,Desc)
It also doesn't rank the rows properly.
It also doesn't rank the rows properly.