cancel
Showing results for
Did you mean:
Highlighted
Member

## RANKX using Column Issue: It Ties Values which shouldn't be tied

Hi, I am following posts to understand RANKX and am working on the Column based solution https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

I have created a version of the measure to work with Articles within Departments (Each Dept has unique set of Articles).  Each Article has a separate table with Sales figures, joined using an Article_No to the Article Dimension.

The Measure calculates a ranking within each department, to identify top selling articles within each Dept:

Article Rank by Dept Column = RANKX( FILTER('dim_article', 'dim_article'[Dept]=EARLIER('dim_article'[Dept]))

[Net Sales])  and Net Sales is a measure in a separate table - simply a sum over the sales column.

The issue is the result - this is filtered using a slicer to a single dept, so the list should rank using the Net Sales.

1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

## Re: RANKX using Column Issue: It Ties Values which shouldn't be tied

Hi @danno

Try the below

```Article Rank by Dept Column =
RANKX(
CALCULATETABLE(
dim_article,
ALLEXCEPT( dim_article, dim_article[Dept] )
),
[Net Sales],
,,DENSE
)```

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Member

## Re: RANKX using Column Issue: It Ties Values which shouldn't be tied

 Article Rank by Dept Column Net Sales £k 1 158992.6 3 148215.3 3 146118.4 4 136670.7 6 126321.9 6 125466.7 8 113794.9 9 113731.1 9 111070.4 11 110030
New Contributor

## Re: RANKX using Column Issue: It Ties Values which shouldn't be tied

Hi @danno

Try the below

```Article Rank by Dept Column =
RANKX(
CALCULATETABLE(
dim_article,
ALLEXCEPT( dim_article, dim_article[Dept] )
),
[Net Sales],
,,DENSE
)```

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Member

## Re: RANKX using Column Issue: It Ties Values which shouldn't be tied

Thanks Marius, that worked a treat!!