Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I am trying to rank agents by sales based on selected date range
I have this rank formula
Hi @paguy215 ,
The issue you're facing with duplicate rankings, even when the RevenueSum values are different, is likely due to floating-point precision or the lack of a unique tiebreaker. To resolve this, you can enhance your ranking formula by adding a tiebreaker that ensures uniqueness. This can be achieved by incorporating a unique identifier for each agent, such as their Agent ID, into the ranking logic. Here's the updated formula:
Rank =
RANKX(
ALLSELECTED('Agent List'),
CALCULATE(SUM(Query1[RevenueSum])) + DIVIDE(UNIQUEVALUE('Agent List'[Agent ID]), 1000000),
,
ASC,
Skip
)
In this formula, the primary ranking is still based on the RevenueSum, but by adding the agent's unique ID (scaled down to a negligible value), you introduce a secondary criterion to break ties. The division ensures that the ID doesn't significantly alter the primary ranking while still differentiating agents with similar RevenueSum values. If the issue persists, you can also round the RevenueSum values in the formula to ensure consistent precision, as shown below:
Rank =
RANKX(
ALLSELECTED('Agent List'),
ROUND(CALCULATE(SUM(Query1[RevenueSum])), 2) + DIVIDE(UNIQUEVALUE('Agent List'[Agent ID]), 1000000),
,
ASC,
Skip
)
This ensures that any minor inconsistencies caused by floating-point precision are eliminated. These changes should resolve your issue and ensure accurate ranking across all scenarios, including when filtering by a date range. Let me know if you encounter any further challenges.
Best regards,
Thanks for the help...however, I still can't get it to work. UNIQUEVALUE doesn't appear to be an option to use in my version. I tried it with DISTINCT and I get an error saying "multiple values were supplied when a single value was expected"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
15 | |
11 | |
10 | |
10 |