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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dynamic ranking based on slicer selection

Hi All -- Need one help with dynamic ranking based on slicer selection. Link has the PBIX file along with data. What I am trying to see is based on my year / month / quarter selection it should give correct ranking in the table like 1,2,3 ...

 

PBIX Code and Data Source 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

It works fine.  See the highlighted portion in the image

Untitled.png


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

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

It works fine.  See the highlighted portion in the image

Untitled.png


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

Hi Ashish,

 

Solution is great however, I have a quick question related to this if you can please answer?

 

I am making a selection through Slicer/Filters where in the background data I have 42 distinct rows. When I create this rank formula, it assigns rank to all 42 but doesnt change (reduce) if i filter few through selection. Like I am making a selection that results in 8 data points, the column technically assign rank till 8 and not all 42 correct?

 

Please help?

 

Thanks

Thank you.  That is an sold post.  Please describe your question, share some data and show the expected result.


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

Yes this is an old post. You can find my question here where I am not able to get the solution.. If you can please.

 

https://community.powerbi.com/t5/Desktop/Dynamic-x-axis-numbering-based-on-filtering/m-p/2682275#M93...

 

Thanks much

The reply by Anonymous has been marked as Answer.  Have you tried that solution?


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

Yes that is not exactly this solution, solution is for the second part to basically make a graph dynamic and show us visual based on selection.

 

If i can rank data rows based on selection, I can then use a concatenate column and then use it in the graph to basically disguise the client names on x axis and use Client 1, Client 2 etc based on selection and rank assigned.

 

Hi,

I do not think that will help either because measures cannot be dragged to the X-axis of a graph.  If you write a calculated column formula, then they will not respond to a change in slicers.


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

Is it. Ok thanks for your reply.

Anonymous
Not applicable

Thank you. That helped

You are welcome.


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

@Anonymous  please try this and test the output

 

Measure 6 =
RANKX (
    CALCULATETABLE (
        VALUES ( Sale[Sales Person] ),
        FILTER (
            ALLSELECTED ( Sale ),
            Sale[Date].[Year] = SELECTEDVALUE ( Sale[Date].[Year] )
        )
    ),
    CALCULATE (
        DIVIDE ( CALCULATE ( SUM ( Sale[Sales] ) ), CALCULATE ( SUM ( Sale[Target] ) ) )
    ),
    ,
    DESC,
    DENSE
)

Capture.PNGx.PNG

Big thanks to @Zubair_Muhammad 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.