The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
80 | |
78 | |
43 | |
37 |
User | Count |
---|---|
158 | |
111 | |
64 | |
59 | |
54 |