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
Forgive me 😊Im a little new to DAX ---
Below I show my table PBI_ae272LeadsReport
How do I create a MEASURE that will rank the CLIENT # column in descending order ....based on values in the 'LFT_Purchase' column?
Ive tried writing the DAX but Im doing something wrong ---need your help please
Solved! Go to Solution.
Hi, @Anonymous
You don’t have to use a measure to rank the value of [LFT Purchase], you can just do it in power query editor, you can follow my steps:
If you still want to achieve this in DAX, you can try this calculated column:
Rank = RANKX(PBI,MAX('PBI'[LFT Purchase]),,DESC)
If you this way is not suitable for your requirement, you can reply to me and post some sample data(without sensitive data) and your expected result.
Here are some good blog that tell how to sort columns using dax, you can follow these links to learn more about sorting in power bi:
https://www.wiseowl.co.uk/blog/s2469/rankx-function.htm
https://powerbi.tips/2019/09/custom-sort-order-within-a-dax-measure/
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
You don’t have to use a measure to rank the value of [LFT Purchase], you can just do it in power query editor, you can follow my steps:
If you still want to achieve this in DAX, you can try this calculated column:
Rank = RANKX(PBI,MAX('PBI'[LFT Purchase]),,DESC)
If you this way is not suitable for your requirement, you can reply to me and post some sample data(without sensitive data) and your expected result.
Here are some good blog that tell how to sort columns using dax, you can follow these links to learn more about sorting in power bi:
https://www.wiseowl.co.uk/blog/s2469/rankx-function.htm
https://powerbi.tips/2019/09/custom-sort-order-within-a-dax-measure/
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You can have column/static rank
rankx(All(Table[client#]), [LFT_Purchase],,desc, dense)
measure rank
rankx(All(Table[client#]), calculate(sum(Table[LFT_Purchase])),,desc, dense)
or
rankx(Allselected(Table[client#]), calculate(sum(Table[LFT_Purchase])),,desc, dense)
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
89 | |
85 | |
73 | |
49 |
User | Count |
---|---|
167 | |
147 | |
92 | |
70 | |
58 |