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 am have a measure that ranks sales people by a defined KPI ($ Rolling GM per Ton).
# OSR GM per Ton Rank =
RANKX(
FILTER(
ALL(OSRs[OSR_NAME]),
NOT(ISBLANK(OSRs[OSR_NAME]))
),
Sales[$ Rolling GM per Ton],
,
DESC,
DENSE
)
$ Rolling GM per Ton is a measure that calculates GM per ton for the previous year period.
$ Rolling GM per Ton =
CALCULATE(
Sales[$ GM per Ton],
DATESBETWEEN(
'Calendar'[DATE_DESC],
NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE('Calendar'[DATE_DESC]))),
LASTDATE('Calendar'[DATE_DESC])
)
)
I have created a table visual consisting of the sales person name, $ Rolling GM per Ton, and # OSR GM per Ton Rank. The table has a visual level relative date filter setting 'Calendar'[DATE_DESC] to show results in the last 365 days. This visual correctly ranks each sales person.
I have created a card visual that displays # OSR GM per Ton Rank. When I select a row for a specific sales person in my table visual, I would expect the card visual to display the same value for #OSR GM per Ton Rank that is displayed in the table. However, this is not the case. The card visual generally shows one rank lower than what is displayed in the table. For example, if the rank in the table is 2, the card visual displays 3. This is not consistent, though. For some sales people, the rank displayed is the same in the card and in the table.
I feel like there is something I'm missing in the filter context being applied to the # OSR GM per Ton Rank measure when it is displayed outside the table visual, but I can't figure it out.
Any ideas?
Thanks!
Solved! Go to Solution.
Please try to move NOT(ISBLANK(OSRs[OSR_NAME]) filter to your calculation of and try
# OSR GM per Ton Rank =
RANKX(
FILTER(
ALL(OSRs[OSR_NAME]),
NOT(ISBLANK(OSRs[OSR_NAME]))
),
Sales[$ Rolling GM per Ton],
,
DESC,
DENSE
)
Also refer:
https://community.powerbi.com/t5/Desktop/RANKX-woes/m-p/912940#M437593
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
Hi,
Could you share a simple dataset and show the expected result?
Please try to move NOT(ISBLANK(OSRs[OSR_NAME]) filter to your calculation of and try
# OSR GM per Ton Rank =
RANKX(
FILTER(
ALL(OSRs[OSR_NAME]),
NOT(ISBLANK(OSRs[OSR_NAME]))
),
Sales[$ Rolling GM per Ton],
,
DESC,
DENSE
)
Also refer:
https://community.powerbi.com/t5/Desktop/RANKX-woes/m-p/912940#M437593
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
Can you apply the same filter that is on your table to your Card?
Man, I would hate to get into yet another RANKX weirdness problem!! See this beauty! https://community.powerbi.com/t5/Desktop/Rank-by-measure-in-Direct-Query/m-p/953543#M456870
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 |
---|---|
107 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |