Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Ranking (RANKX) the output of measures

Hi community,

 

Is it possible to use RANKX or similar DAX measure or another method to rank the output of measures?

 

I currently have 7 measures in a multi-row card visual to display the top concerns that I’d like to rank / sort by top output to its lowest output. If this is possible, is it also possible to ensure this ranking is kept dynamically? (i.e. when using filter / slicer)

 

Currently I’ve manually sorted it through the field in the visualization panel, but this is not dynamic and will have to be kept updated if the % change when the dashboard is refreshed.

 

Mido999_0-1648232595493.png

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Anonymous 

To be able to have the percentages sorted dynamically, rather than including multiple measures on the visual, you must have:

  • A "Concern" column in a table containing the various Concern values: "Road Closure", "Traffic" etc.
    This could either be a column an existing table (if that is how the data is structured), or a specially created parameter table.
  • A single measure that returns the correct percentage when filtered by the values in the above column.

Then, on the multi-row card, you would include the "Concern" column and the measure.

The appearance of the visual would be a little different to your existing setup, but pretty similar.

 

I have attached a PBIX file showing two possible approaches.

 

1. If you have a table already containing Concern column and you can create a generic percentage measure that will respond to filters on this column, then simply place the column and measure in a multi-row card.

 

2. If you want to make use of the existing measures, you can create a parameter table that contains a column with each possible Concern value, and a measure that switches based on the selected Concern value.
Similar to this article.

OwenAuger_0-1648352557187.png

 

Selected Concern = 
SELECTEDVALUE ( 'Concern parameter'[Concern] )

Selected Concern Percentage = 
SWITCH (
    [Selected Concern],
    "Air Quality", [Air Quality],
    "Lighting", [Lighting],
    "Mud on the roads", [Mud on the roads],
    "Noise", [Noise],
    "Personal Behaviour", [Personal Behaviour],
    "Road Closure", [Road Closure],
    "Traffic", [Traffic]
)

OwenAuger_1-1648352671833.png

 

 

Once placed in the multi-row card visual, the sorting can be set in the "More options" menu.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @Anonymous 

To be able to have the percentages sorted dynamically, rather than including multiple measures on the visual, you must have:

  • A "Concern" column in a table containing the various Concern values: "Road Closure", "Traffic" etc.
    This could either be a column an existing table (if that is how the data is structured), or a specially created parameter table.
  • A single measure that returns the correct percentage when filtered by the values in the above column.

Then, on the multi-row card, you would include the "Concern" column and the measure.

The appearance of the visual would be a little different to your existing setup, but pretty similar.

 

I have attached a PBIX file showing two possible approaches.

 

1. If you have a table already containing Concern column and you can create a generic percentage measure that will respond to filters on this column, then simply place the column and measure in a multi-row card.

 

2. If you want to make use of the existing measures, you can create a parameter table that contains a column with each possible Concern value, and a measure that switches based on the selected Concern value.
Similar to this article.

OwenAuger_0-1648352557187.png

 

Selected Concern = 
SELECTEDVALUE ( 'Concern parameter'[Concern] )

Selected Concern Percentage = 
SWITCH (
    [Selected Concern],
    "Air Quality", [Air Quality],
    "Lighting", [Lighting],
    "Mud on the roads", [Mud on the roads],
    "Noise", [Noise],
    "Personal Behaviour", [Personal Behaviour],
    "Road Closure", [Road Closure],
    "Traffic", [Traffic]
)

OwenAuger_1-1648352671833.png

 

 

Once placed in the multi-row card visual, the sorting can be set in the "More options" menu.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Anonymous
Not applicable

That worked perfectly, thank you.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.