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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AW31
Helper I
Helper I

Dynamic Rank Not Working

I am attempting to create a dynamic rank to rank all filtered name/accounts (Athlete[Name] by total engagments (Sum of likes and shares columns), but the data isn't filtering out even though I'm using ALLSELECTED. For this example, I've filtered by NHL teams but the graph is still acting like all name/accounts in the database are selected, even though the dynamic rank seems to be working for the filtered names. I've attached the formula I attempted to use and how my relationships are managed. Thanks!Pic1.PNGCapture1.PNG

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @AW31,

According to your description, it sounds like you are trying to create a dynamic calculated column to calculate rank based on filter and slicers, right?  If this is a case, current power bi does not support to create dynamic calculate column/table based on filter/slicer. 

In fact, they are work on different data levels, filter and slicer work on data view level which generated from the data model. Power bi does not support using 'sub-level' to effect its 'parent level'.  (Actually, when you enable filter/slicer, you can find they can't affect data model table records)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I see I used filter as the wording, but I think I'm just using slicers? When I use a slicer for NHL teams without the rank column created, it only shows the data for those accounts. When I add in the rank column, it populates all accounts even though only the NHL teams is selected on the slicer. So it may not be possible.

Hi @AW31 ,

Dynamic columns based on selection is impossible, but you can write measure to instead. It will be affected by filters and dynamic change calculation result based on its row contents.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

The formula I used was 

Rank =
Rankx ( ALLSELECTED(Athlete[Name]), Calculate ( [Engagements] ))

This measure was ranking all selections, regardless of my slicers. It ranked the sliced values 1-30, but the other 7500 that were supposed to be sliced out were shown as tied for 31

HI @AW31 ,

Maybe you can try to add an if statement to filter records who have rank larger than 30.

Rank =
VAR _rank =
    RANKX ( ALLSELECTED ( Athlete[Name] ), CALCULATE ( [Engagements] ) )
RETURN
    IF ( _rank <= 30, _rank )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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