Forum Discussion
Rank
- Anonymous2 years ago
Thank you OwenAuger and SamWiseOwl
Hi, JamesBurke
Based on your descriptive information, as well as the example data provided and the expected output, I created the following example data:
I created a measure using this DAX expression below:
Rank = VAR _rank = RANK ( FILTER ( ALLSELECTED ( 'Emporia Devices' ), 'Emporia Devices'[Wawrick Device Name] <> BLANK () ), ORDERBY ( CALCULATE ( SUM ( 'Emporia Devices'[Total Solar Generated] ) ), DESC, CALCULATE ( MAX ( 'Emporia Devices'[Store Name] ) ), ASC ) ) RETURN IF ( SELECTEDVALUE ( 'Emporia Devices'[Wawrick Device Name] ) <> BLANK (), _rank, BLANK () )The results are as follows:
I have provided the PBIX file used in this instance below.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, JamesBurke
Thank you for your reply. Can you adjust the DAX expression provided above to suit your data set requirements? In your report, there may be different contexts that affect the rank results.
In the DAX expression I provided, the primary and secondary sorts are mainly implemented through ORDERBY.
The first parameter is the primary sorting basis: 'Emporia Devices'[Total Solar Generated]
The third parameter implements the secondary sorting (based on the sorting of one parameter): 'Emporia Devices'[Store Name]
In this way, Store can be considered when sorting Usages.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI Anonymous ,
Was a case of changing all selected from the entire Table to the specfic column so it was all selected.
Thanks for your response.
James.
- Anonymous2 years agoNot applicable
Hi, JamesBurke
Have you solved the current problem? If yes, you can mark the helpful reply as a solution so that others in the community can find the answer quickly. If no, can you continue to describe your dataset in detail or provide some sample PBIX files that are closest to your situation and do not contain privacy?
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.