Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Test Ranking2 =
var test = Table[Slicer]
var NumericValue =IF( CONTAINSSTRING(test, "%"), VALUE(SUBSTITUTE(test, "%", "")), IF (CONTAINSSTRING(test, "$"), VALUE(SUBSTITUTE(test, "$", "")), BLANK() ))
return
RANKX(FILTER(ALL(Table[IsoCode]), NumericValue), NumericValue,,ASC)
I want to rank ISO Code column based on value in Slicer. Slicer has both % and $ values based on selected column, so I created NumericValue variable to convert all values to type number and remove % or $ for calculation. My $ values are based on Sum of column grouped by ISO Code and % are based on Average of column grouped by ISO Code.
I tried different forms in expression field like :
1. returns 1 for all ISO Codes
MAXX(WinLossDataWithCountry,NumericValue) 2. returns different numbers with duplicate ranking but giving value 10000 and 400 same rank. So its wrong
SUMX(WinLossDataWithCountry,NumericValue)
Hi,
I am not sure how your datamodel looks like, but can you try something like below if it works?
Test Ranking2 =
VAR test = Table[Slicer]
RETURN
RANKX (
ALL ( Table[IsoCode] ),
CALCULATE (
IF (
CONTAINSSTRING ( test, "%" ),
VALUE ( SUBSTITUTE ( test, "%", "" ) ),
IF (
CONTAINSSTRING ( test, "$" ),
VALUE ( SUBSTITUTE ( test, "$", "" ) ),
BLANK ()
)
)
),
,
ASC
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 21 | |
| 10 | |
| 7 | |
| 7 |