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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
KTK
Frequent Visitor

Ranking a table visulaisation that updates when slicer changes

Hi,

I hope someone can help as I have been looking at this for ages! I have created a table visualisation that shows modules, student names and their exam score. What I have then done is add a ranking formula that calculates on the whole table (multiple learners can study multiple modules). What I want to be able to do is select a module in the slicer and the Student Ranking updates for the new selection so it restarts at 1, 2 etc rather than starting at 510, say.

 

The formulae I have used is:

 

Student Ranking = RANKX(FILTER(ALL('Student Scores'),'Student Scores'[Score %] <> BLANK()),'Student Scores'[Score %],,DESC,Dense)

 

KTK_0-1716315345086.png

Is this possible?

Thanks

 

1 ACCEPTED SOLUTION

Not sure why it is not working! All we are trying to do is get the value(s) of slicer and remove blanks and then rank!

 

Try one at a time and see 

 

 

Ranking = RANKX( ALLSELECTED('Student Scores'[Module]), [Score %],,DESC,Dense) 



Ranking = RANKX( ALLSELECTED('Student Scores'[Student Name]), [Score %],,DESC,Dense) 


Ranking = RANKX( FILTER( ALLSELECTED('Student Scores'[Module]) , 'Student Scores'[Score %] <> BLANK()) , [Score %],,DESC,Dense) 

Ranking = RANKX( FILTER( ALLSELECTED( 'Student Scores'[Student Name]) , 'Student Scores'[Score %] <> BLANK()) , [Score %],,DESC,Dense) 

 

 

 

Ranking = RANKX(
             FILTER( ALLSELECTED('Student Scores'[Module], 'Student Scores'[Student Name])
                    , 'Student Scores'[Score %] <> BLANK())
    , [Score %],,DESC,Dense)

 

If not, pls share the data by removing sensitive info!

 

View solution in original post

5 REPLIES 5
sevenhills
Super User
Super User

Can you try this?

Student Ranking =
 RANKX(FILTER(ALLSELECTED('Student Scores'),'Student Scores'[Score %] <> BLANK()),'Student Scores'[Score %],,DESC,Dense)

Hi 

Thanks for replying. I have just tried it and filtered but the Student Ranking still starts from 171 rather than 1...

 

KTK_0-1716319308744.png

 

Ranking = RANKX(
             FILTER( ALLSELECTED('Student Scores'[Module], 'Student Scores'[Student Name])
                    , 'Student Scores'[Score %] <> BLANK())
    , [Score %],,DESC,Dense) 

 

How about this?

Hi,

Thanks for looking at this. That just gives 1's in the column. I'm thinking I need to go back to the source file and add rankings in there.

Not sure why it is not working! All we are trying to do is get the value(s) of slicer and remove blanks and then rank!

 

Try one at a time and see 

 

 

Ranking = RANKX( ALLSELECTED('Student Scores'[Module]), [Score %],,DESC,Dense) 



Ranking = RANKX( ALLSELECTED('Student Scores'[Student Name]), [Score %],,DESC,Dense) 


Ranking = RANKX( FILTER( ALLSELECTED('Student Scores'[Module]) , 'Student Scores'[Score %] <> BLANK()) , [Score %],,DESC,Dense) 

Ranking = RANKX( FILTER( ALLSELECTED( 'Student Scores'[Student Name]) , 'Student Scores'[Score %] <> BLANK()) , [Score %],,DESC,Dense) 

 

 

 

Ranking = RANKX(
             FILTER( ALLSELECTED('Student Scores'[Module], 'Student Scores'[Student Name])
                    , 'Student Scores'[Score %] <> BLANK())
    , [Score %],,DESC,Dense)

 

If not, pls share the data by removing sensitive info!

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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