Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I have a duplicate ranking issue. At an overall level, it's fine, however bringing in multiple columns creates duplicate rankings.
As you can see overall is fine, but group 1 has multiple 12's. I want unique rankings for each category based on it's volume. This is my formula:
Hi, @Sammm888
First, create a Index in PowerQuery.
Then click Apply&Close.
Create a calculated column, and treat the Index you just created as a secondary sort, which must be uniquely identified and cannot have duplicate values. Otherwise, when your sort has the same value and the sub-sort value is the same, the rank will be the same. Here is my preview:
Column = ROWNUMBER(ORDERBY('Table'[Totalvols],DESC,'Table'[Index],ASC))
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yohua-msft - I dont agree with this solution, though you are correct, it removes the duplicates. In terms of ranking, the duplicates are legitamately there.
If a business user was to ask what the criteria was for separating the items that have 100 as a total volume, the answer would be "random chance" and that's not acceptable. It could lead to a poor decision being made by an organisation.
@Sammm888 - firstly you need to include all columns from your visual in the ranking, this is what is causing your duplication, secondly I would suggest putting the filtering on the visual and taking it out of the ranking. Please try the code below:
RANKX (ALLSELECTED('Table1'[SubCat], 'Table1'[Group]),[Totalvols],,DESC)
If you find you still need the filtering, you can use the ALLSELECTED from my code, rather than the ALL from yours.
If this works, please accept this as the solution, if it does not, please supply some sample data for me to test.
Sadly this is now ranking across all columns rather ranking for each individual column. I will try and provide sample data, but need to remove sensitive data first.
@Sammm888 - Sorry for the late response, I have been travelling a lot the last 2 days.
I misread your challenge the first time, so my code was not going to work for you, sorry about that.
Having seen your screenshot, I can see why you have duplicate rankings. In group 1 you have 3 [Totalvols] of 89, 3 [Totalvols] of 117 and 3 visible 153's.
These will all be producing duplicate ranks because they have the same value. If you want them to have different ranks, you need to provide another measure to break the ties.
Hi,
These are not the volumes, this is the output of your code. There are very few rows that have the same volumes
I see, then we still need some sample data to understand why you are getting duplicates.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
26 | |
24 | |
12 | |
11 | |
10 |