Forum Discussion
Make continuous ranking if values are the same
- 3 years ago
Hi,
Thank you for your message, and please check the below picture and the attached pbix file.
Rank: = VAR _table = ADDCOLUMNS ( ADDCOLUMNS ( ALL ( Intakes[Sourcers.Title] ), "@rankone", CALCULATE ( RANKX ( ALL ( Intakes[Sourcers.Title] ), [Intakes:],, DESC ) ), "@ranktwo", CALCULATE ( RANKX ( ALL ( Intakes[Sourcers.Title] ), CALCULATE ( MAX ( Intakes[Sourcers.Title] ) ), , ASC ) ) ), "@newindex", [@rankone] * 100 + [@ranktwo] ) VAR _newtable = ADDCOLUMNS ( _table, "@newrank", RANKX ( _table, [@newindex],, ASC ) ) RETURN IF ( HASONEVALUE ( Intakes[Sourcers.Title] ), MAXX ( FILTER ( _newtable, Intakes[Sourcers.Title] = MAX ( Intakes[Sourcers.Title] ) ), [@newrank] ) )
Hi Jihwan_Kim ,
Hope you are able to resolve this one as well. I added an image from an URL to a separate table with all names of the employees and converted that to type imageURL. It displays the correct image to the belonging person, however it breaks the ranking. I tried to add the image as @columnthree in your measure, but it doesnt work properly.
My data still looks like this
| Sourcers.Title |
| Kevin |
| Jane |
| Kevin |
| Jane |
| Rob |
| Joy |
| Joy |
| Kevin |
| Jane |
Based on these measures, the tablevisual would look like this:
| Rank | Sourcers.Title | Intakes |
| 1 | Kevin | 3 |
| 1 | Jane | 3 |
| 3 | Joy | 2 |
| 4 | Rob | 1 |
I have a separate table with a relationship 1:* with Sourcers.title -> Medewerkers.Title
| Medewerkers.Title | ImageURL |
| Jane | www.jane.com/test |
| Rob | www.rob.com/test |
| Joy | www.joy.com/testtest |
You can see that the ranking is 1 for everyone below but it should be the same as in your previous solution. Tried to add a @columnthree to the measure you gave me, but couldnt get it correct.
Hope you got the solution for this as well, as it would finalize my report. Thanks in advance!
Kind Regards,
Soof1234
Hi,
Please share your sample pbix file's link, and then I can try to look into it to come up with a solution.
If you add a column to the table, in most cases, datamodel is considered as different. Which means, in some cases, measures has to be fixed to show expected results.
- Soof12343 years agoHelper I
Hi,
Thanks for the help. I cannot upload a file here, but uploaded it on a filesharing website. I used dummy data but with exactly the same column names. I added a third ADDCOLUMN in the measure you supplied but couldnt retrieve the correct rank.
This is the part I added:
,"@rankthree",CALCULATE (RANKX (ALL ( Medewerkers[ProfilePic.Url]),CALCULATE ( MAX ( Medewerkers[ProfilePic.Url] ) ),,ASC))),
The link to the dummy file:Thanks in advance!Kind Regards, Soof1234- Jihwan_Kim3 years agoSuper User
Hi,
I cannot open the file in the link.
- Soof12343 years agoHelper I