Forum Discussion
sophie-burgess
7 months agoRegular Visitor
RANKX Formula duplicating ranks when value is the same
Hey team, I have been trying for hours to get my RANKX formula to work but to no avail. What I need is for my RANK measure to rank my group names by my YTD amount measure. I used the below fo...
- 7 months ago
Hey everyone,
Thanks for the help but I've managed to find a solution by reading up on some articles, below was all I needed to do:
Rank =RANK (DENSE,ALLSELECTED ( 'bcs vw_pbi_sales_detail'[Group Name] ),ORDERBY ( [YTD Amount], DESC, 'bcs vw_pbi_sales_detail'[Group Name], ASC ))Thanks
BeaBF
Super User
7 months agosophie-burgess Hi! Try:
Rank =
VAR CurrentYTD = [YTD Amount]
VAR CurrentGroup = SELECTEDVALUE('bcs vw_pbi_sales_detail'[Group Name])
RETURN
RANKX(
ALLSELECTED('bcs vw_pbi_sales_detail'[Group Name]),
[YTD Amount]
+
DIVIDE(
RANKX(
ALLSELECTED('bcs vw_pbi_sales_detail'[Group Name]),
SELECTEDVALUE('bcs vw_pbi_sales_detail'[Group Name]),
,
ASC
),
1000000
),
,
DESC,
Skip
)
BBF
💡 Did I answer your question? Mark my post as a solution!
👍 Kudos are appreciated
🔥 Proud to be a Super User!
sophie-burgess
7 months agoRegular Visitor
Hey BeaBF,
I'm afraid this didn't change anything - I'm still seeing the duplicating rank numbers for group names where the YTS is 0 😞
Cheers