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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
amsrivastavaa
Helper III
Helper III

Dynamic RANK Column based on Slicer selection

Hi Guys!!

 

I need to create RANK COLUtMN in such as way that it will dynamically change if slicer is applied, i,e,

 

Let say, I have table as shown below : 

 

ProjectYearRevenueRANK
P-120171106
P-220171505
P-320172504
P-120183503
P-220184502
P-320185501

 

 

I have sclier of Project.

 

What I want is, when I have selected P-1 and P-3 project in the slicer, our table will look like that with chaning RANK.

 

ProjectYearRevenueRANK
P-120171104
P-320172503
P-120183502
P-320185501

 

i.e. RANK Will be calculated based on what ever data left, as in this case, as soon as P-2 was unselected, RANK will be based on what ever the data left.

 

I need RANK as COLUMN of table NOT as a MEASURE which will be used in the VISUAL for filteration.

 

Thanks

Amit Srivastava

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

You should write a measure for this and then drag that measure to the filter pane for applying conditions.  These measures work

Rev = SUM(Data[Revenue])
Rank = RANKX(GENERATE(ALLSELECTED(Data[Project]),ALLSELECTED(Data[Year])),[Rev])

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

Thanks for the reply 

 

Actually, I have achieved this via Measure as you suggested however it does not suits my ultimate requirement.

 

 

Below is the detail of my ultimate requirements, please provide your thoughts on the same.

 

https://community.powerbi.com/t5/Desktop/Power-BI/m-p/2876038#M990104

 

Thanks

Amit Srivastava 

 

 

Anonymous
Not applicable

HI @amsrivastavaa,

Current power bi does not support creating dynamic calculated columns/tables based on filter effect, they do not work on the same data levels. Please create a measure expression instead.

Notice: the data level of power bi(from parent to child level)

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

Hi @Anonymous , Thanks for the message.

 

Below is the URL of my ultimate requirement, please suggest whether it is possible to implement the same..

 

https://community.powerbi.com/t5/Desktop/Power-BI/m-p/2876038#M990104

 

Thanks

Amit 

 

Anonymous
Not applicable

Hi @amsrivastavaa,

It seems like you want to ranking a report that design as dynamic attribute report.

Dynamic Attributes In A Power BI Report 

Current rank function seems not suitable to ranking based on multiple fields, you can try write a measure formula to use countrow with isonorafter function instead of the rankx.

Sorting by multiple columns 

ISONORAFTER function (DAX) - DAX | Microsoft Learn

Regards,

Xiaoxin Sheng

Hi @Anonymous ,

 

I am able to manage Ranks, Thanks for your help.

 

Could you please help me on my ultimate requirement that has been detailed in below URL

 

https://community.powerbi.com/t5/Desktop/Power-BI/m-p/2876038#M990104

 

Thanks

Amit 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Kudoed Authors