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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

RANKX with customizable variable

Hello everyone, I'm trying to create a dynamic ranking with variables.

I currently have a table with category and total and it has a measure that shows the ranking of each one.

 

cleytonp_0-1714873087644.png

However, I have an option to select values ​​in the case of categories, which must add up, for example if I select the category or multiple categories, the original rank will dynamically update according to the selected one.

cleytonp_1-1714873546664.png

 

here the file with data and measures i used.

pbix gdrive 

1 ACCEPTED SOLUTION

Hi @Anonymous 

In order for those combined category to appear based on the slicer selection, they need to physically exist first in your which means that there should be a column in your model showing all the possible combinations of those categories.  Example:

danextian_0-1715148248534.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Thanks @lbendlin.
The case is to update this table with A + C + E + F which would give the total value of 16 and would be number 1 in the ranking, looking as follows.

cleytonp_0-1714922807828.png

How can do this?

cleytonp_1-1714923014033.png

In other words, the ranking remains the original and the selected categories become a variable adding the name of the category and the value it has in each one

 

Hi @Anonymous 

In order for those combined category to appear based on the slicer selection, they need to physically exist first in your which means that there should be a column in your model showing all the possible combinations of those categories.  Example:

danextian_0-1715148248534.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Adding the same data to the same visual twice is a design red flag.  Don't do it.  Use separate visuals (as you already did)

Anonymous
Not applicable

@lbendlin I don't understand, because the idea is to add it to the table where the visual already exists, that is, I keep the table and reorder it according to the selectable.

 

cleytonp_0-1714925084857.png

 

This is the final result that I expect in the case you mentioned with the selected options, that is, I add the sum of each selected category, this way it is top 1 in the ranking.

Anonymous
Not applicable

If I do not select any item, the table continues without changing the ranking, as follows.

cleytonp_1-1714925523173.png

However, if I select an item it must be iterated and added to its total and moved to a new position in the ranking, example image below.

cleytonp_2-1714925719176.png

 

I cannot assist you with this request, I don't think that is right. Maybe someone else can help you further.

Anonymous
Not applicable

Thanks for your help @lbendlin.

It really was as far as I got and I wasted a few days on this, I hope someone can help me.
grateful

lbendlin
Super User
Super User

You were close

 

lbendlin_0-1714920488985.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors