cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Regular Visitor

## Rank values without duplicate ranking

Dear Community,

I tried to get the ranking displayed in column "Rank" by using Rankx - without success.

The idea is to rank the amounts in column "€" for each month. When there are duplicate values (e. g. 2.950 € in March) the first apperance should be 3 for instance and all following rankings for the the values should get the next higher number - in this case 4.

Is there any solution for this? Thanks in advance!

1 ACCEPTED SOLUTION
Community Champion

We can take help from an Index column to manage duplicates

First add an index columm from Query Editor. Then this DAX calculated column

```Rank Column =
RANKX (
FILTER (
Table1,
Table1[date].[Month] = EARLIER ( Table1[date].[Month] )
&& Table1[date].[Year] = EARLIER ( Table1[date].[Year] )
),
[Euro]
- [Index] / POWER ( 10, 9 ),
,
DESC,
DENSE
)
```

Regards
Zubair

2 REPLIES 2
Community Champion

We can take help from an Index column to manage duplicates

First add an index columm from Query Editor. Then this DAX calculated column

```Rank Column =
RANKX (
FILTER (
Table1,
Table1[date].[Month] = EARLIER ( Table1[date].[Month] )
&& Table1[date].[Year] = EARLIER ( Table1[date].[Year] )
),
[Euro]
- [Index] / POWER ( 10, 9 ),
,
DESC,
DENSE
)
```

Regards
Zubair

Frequent Visitor

Hello,
How to avoid duplication on a measure?
With your technique, "it is impossible to determine a unique value for the INDEX column".

Thanks

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors