Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a problem with RANKX with ASC method. To put my question in a nutshell, the result of the measure is very absurd. For example, while there are 100 observations in total for the criteria I chose, the result is 5000.
Which tables I have:
bio_data[unique, league, season, template_position]
def_data[unique, def_label, def_value]
Info:
"unique" is the key value connecting both tables. def_data has a long format. So that means there is one-to-many relationship between bio_data and def_data.
Purpose:
I want to measure the number of observations and rank according to the criteria chosen by the user. Actually, both of my measurements work properly. For example:
Solved! Go to Solution.
Thanks for the answers. I finally figured it out.
Thanks for the answers. I finally figured it out.
@sezerunar Hi!
Try with this adjusted measure:
VAR SelectedSpecialId = SELECTEDVALUE(bio_data[unique])
VAR SelectedLeague = SELECTEDVALUE(bio_data[league])
VAR PositionFilter = SELECTEDVALUE(YES_NO_TABLE[Filter]) = "Yes"
VAR DefoultPosition = SELECTEDVALUE(bio_data[template_position])
VAR SelectedPositions = ALLSELECTED(POSITION_ORDER[template_position])
VAR CurrentDefLabel = SELECTEDVALUE(def_data[def_label])
VAR FictionalTable =
CALCULATETABLE(
VALUES(bio_data[unique]),
ALL(bio_data),
bio_data[league] = SelectedLeague &&
(IF(PositionFilter, bio_data[template_position] = DefoultPosition, bio_data[template_position] IN SelectedPositions) || bio_data[unique] = SelectedSpecialId)
)
VAR UniqueObservations = FictionalTable
VAR TotalPlayers = COUNTROWS(FictionalTable)
RETURN
TotalPlayers + 1 - RANKX (
FILTER(
ALLEXCEPT(def_data, def_data[def_label]),
(
def_data[unique] IN UniqueObservations
)
),
CALCULATE ( SUM(def_data[def_value]),
(
def_data[unique] IN UniqueObservations
)
),
,
DESC
)
BBF
Hello @sezerunar,
Here's a couple of things to consider and troubleshooting steps you can take:
Should you require any further assistance, please do not hesitate to reach out to me.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
26 | |
22 | |
12 | |
7 |
User | Count |
---|---|
73 | |
51 | |
45 | |
16 | |
12 |