Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a rank formula that ranks people based on a 'Score' ;this is column 2. This score is a measure that calculates a number based on weights assigned for multiple factors like Avg sales, YoY change,etc to produce an overall score.; this is column 3.
Column 2 is ranking values in column 3 based on the following formula:
Overall RTD Rank FF =
var x1=IF(NOT (ISBLANK ([Overall RTD Score FF])),RANKX(FILTER(ALLSELECTED('SUP-SR by Format'[ASM]),NOT(ISBLANK([Overall RTD Score FF]))),[Overall RTD Score FF],,ASC))
var x2=IF(NOT (ISBLANK([Overall RTD Score FF])),RANKX(FILTER(ALLSELECTED('SUP-SR by Format'[SR ]),NOT(ISBLANK([Overall RTD Score FF]))),[Overall RTD Score FF],,ASC,Dense))
return
IF(ISINSCOPE('SUP-SR by Format'[SR ]) ,x2,x1)
All works as expected. However, there is a requirement that for certain branches the can buy or column 1 should be greater than a certain threshold. So I created a column 5 measure that will score only those above that threshold for the specified branches like so.
CB Overall RTD Score FF =
IF(SELECTEDVALUE('SUP-SR by Format'[BRANCH])="A" || SELECTEDVALUE('SUP-SR by Format'[BRANCH])= "B"|| SELECTEDVALUE('SUP-SR by Format'[BRANCH])= "C",
IF([Can Buy]>30,
([AVG Sales Rank FF]*0.15+[Sales % Change Rank FF]*0.20+[MPD Rank FF]*0.15+[MPD % Change Rank FF]*0.50)),
IF(SELECTEDVALUE('SUP-SR by Format'[BRANCH])<>"A"|| SELECTEDVALUE('SUP-SR by Format'[BRANCH])<>"B"||SELECTEDVALUE('SUP-SR by Format'[BRANCH])<> "C",
([AVG Sales Rank FF]*0.15+[Sales % Change Rank FF]*0.20+[MPD Rank FF]*0.15+[MPD % Change Rank FF]*0.50)
)
)
This works just fine as well.
The issue arises when I now try to rank by this newly created column 5.
Column 4 is ranking values in column 5 based on the following formula (Very similar to how column2 was ranking column3):
Overall RTD CB_Rank FF =
var x1=IF(NOT (ISBLANK ([CB Overall RTD Score FF])) ,RANKX(FILTER(ALLSELECTED('SUP-SR by Format'[ASM]),NOT(ISBLANK([CB Overall RTD Score FF]))),[CB Overall RTD Score FF],,ASC))
var x2=IF(NOT (ISBLANK([CB Overall RTD Score FF])),RANKX(FILTER(ALLSELECTED('SUP-SR by Format'[SR ]),NOT(ISBLANK([CB Overall RTD Score FF]))),[CB Overall RTD Score FF],,ASC,Dense))
return
IF(ISINSCOPE('SUP-SR by Format'[SR ]) ,x2,x1)
This resultant rank in column 4 starts at 2 instead of 1, skips 4 and 5 and falsely ties 8th places for three people like highlighted below.
Could someone please point me to what I am doing wrong here?
@Neo_44 , Try if this change can help
overall rtd cb_rank ff =
if(not(isblank([cb overall rtd score ff])),
rankx(filter(allselected('sup-sr by format'[asm]),not(isblank([cb overall rtd score ff]))),[cb overall rtd score ff],,asc),
blank())
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |