cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mnayar Established Member
Established Member

Rank Relative to a Chosen Value's Rank

Data: I have 1 table with a column, and sales for that column. I have ranked them based on sales. 

This table has a slicer on ItemSalesRegion (i.e. A,B,C,D)

 

ItemSalesRank

A(Region)10(Sales)3(Rank)
B202
C581
D54

 

Requirement: Based on the value chosen in slicer I want to find relative rank of every item in Column 1. For example if I chose B, I want the following output. I also want the whole data set to show and the slicer not filter to B(chosen Filter). 

 

ItemSalesRankRelative To Chosen B

A103-1
B2020
C5811
D54-2

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Rank Relative to a Chosen Value's Rank

Hi @mnayar

 

I believe you will need a supporting Table to achieve this

 

If RANK is a calculated column, then you can create a calculated table from the modelling tab

 

Items =
ALL ( Table1[Item], Table1[RANK] )

And use it as a slicer.

 

Then use following MEASURE

 

Relative RANK =
VAR myrank =
    SELECTEDVALUE ( Items[RANK] )
RETURN
    myrank - SELECTEDVALUE ( Table1[RANK] )

View solution in original post

Highlighted
Super User
Super User

Re: Rank Relative to a Chosen Value's Rank

@mnayar

 

See attached file as well

 

relativerank.png

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Rank Relative to a Chosen Value's Rank

Hi @mnayar

 

I believe you will need a supporting Table to achieve this

 

If RANK is a calculated column, then you can create a calculated table from the modelling tab

 

Items =
ALL ( Table1[Item], Table1[RANK] )

And use it as a slicer.

 

Then use following MEASURE

 

Relative RANK =
VAR myrank =
    SELECTEDVALUE ( Items[RANK] )
RETURN
    myrank - SELECTEDVALUE ( Table1[RANK] )

View solution in original post

Highlighted
Super User
Super User

Re: Rank Relative to a Chosen Value's Rank

@mnayar

 

See attached file as well

 

relativerank.png

View solution in original post

Community Support Team
Community Support Team

Re: Rank Relative to a Chosen Value's Rank

Hi @mnayar,

 

Have you solved your problem?

 

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 194 members 2,474 guests
Please welcome our newest community members: