cancel
Showing results for
Did you mean:
Regular Visitor

I'm sure I'm missing something simple, but the Rank function is giving me a tie when the data clearly shows that there isn't a tie.  Any help is greatly appreciated!!  Below is the formula and a screenshot of the output.

Rank = rankx(ALLSELECTED(Vendor[Vendor]),[Total Recall])

Total Recall is a measure.

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Visitor

## Re: Ranking giving bad results

I believe I might have figured it out.  The following calculation allows me to add the specific items to my visualization without destroying the initial rank.

Rank Recalls = RANKX(ALLSELECTED(Market[Market ID]),CALCULATE([Total Recall],ALLSELECTED(Market[Rep]),ALLSELECTED(Market[Manager])))

8 REPLIES 8
New Contributor

## Re: Ranking giving bad results

Hi codyraptor,

Only with the formula and the Visual, I can't say which part has impact on the Rankx result. If you could share some data sample, it would be greate for us to offer a suggestion.

In addition, take a try to change the formula with the format below:

[Rank] :=

IF(HASONEVALUE(Vendor[Vendor]),
RANKX(ALLSELECTED(Vendor[Vendor]),
[Total Recall]),
BLANK()
)

Besides, check the blog below regarding different scenarios regarding Rankx function, see if it would help here:

Rankx Scenarios

Please post back if you need any further assistance.

Regards

Regular Visitor

## Re: Ranking giving bad results

Rank = if(HASONEVALUE(Vendor[VENDOR_ID]),RANKX(ALLSELECTED(Vendor[VENDOR_ID]),[Total Recall]),BLANK())

This formula seems to work if I only look at "VENDOR_ID" and "RANK" in a table or matrix..etc..

But if I add "Vendor Name" or "State"...any other possible slice to show more info..then rank is no longer valid.  Is there a way to make it dynamic so if I add another piece of data to it..it won't cause an issue.

Ultimately..I would like to have "Rep, Market, Vendor Name, and Rank" in one visual.

New Contributor

## Re: Ranking giving bad results

Hi codyraptor,

How about change the formula into the following one?

Rank = RANKX(ALLSELECTED(Vendor),[Total Recall])

Are "Rep, Market, Vendor Name" all columns, and in one table?

By the way, would it be available for you to share some data samples, so that we could test the formula?

Regards

Regular Visitor

## Re: Ranking giving bad results

Rep and Market are in one table...vendor name is in another one...Trade is in another one...and total recall is in another one.  They're all joined by different keys.

My hope is to say....Rank Total Recall...by market and show the rep assigned to that market.  I can share some test data...am I able to paste a file on this?

Regular Visitor

## Re: Ranking giving bad results

It's almost like it will only allow a rank of one item...so I can rank by Rep..or I can rank by Market..etc...   But if I have it ranking Market..and then just add the rep's name to the visualization...then it blows up.

New Contributor

## Re: Ranking giving bad results

Hi codyraptor,

You could upload the test data into OneDrive or other shared online Drive, then copy and paste the shared link here.

We will take a look at the sample and see what we could suggest.

Regards

Regular Visitor

## Re: Ranking giving bad results

I believe I might have figured it out.  The following calculation allows me to add the specific items to my visualization without destroying the initial rank.

Rank Recalls = RANKX(ALLSELECTED(Market[Market ID]),CALCULATE([Total Recall],ALLSELECTED(Market[Rep]),ALLSELECTED(Market[Manager])))

Highlighted
New Contributor

## Re: Ranking giving bad results

Hi codyraptor,

Thanks for the update.

If you need any further assistance on this topic, please feel free to post back.

Regards

Announcements

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

#### Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

#### PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 170 members 2,551 guests
Recent signins: