Forum Discussion
Power BI desktop - Handling Ties using DAX measure/ RANK
- 9 months ago
Hi Amudha_Kumaran ,
Thanks for the clarification. Based on the behavior you’re seeing, it’s clear that Activity_ID, Days, Counterparty, and all other columns can still repeat, meaning there is no unique row identifier anywhere in the model. When that happens, DAX has no way to distinguish those duplicate rows. A measure can only evaluate values at the column level, it cannot see the underlying physical row or row order inside the engine. Because of this, DAX cannot reliably “pick one random row” when two or more rows are completely identical across every available column.
Since you are also working with a Live Connection, calculated columns and calculated tables are not an option. That leaves only two feasible and supportable solutions:
1. Add a surrogate key / row identifier in the source model
2. Adjust the requirement to a higher grainIf you can add that key, I can provide a clean, simplified RANK-based measure that will give you exactly one Max-Days row per Activity_ID.
Hope this helps.
Thank you.
Hi Anonymous & Zanqueta ,
Thanks a lot for your responses. However, I found that even counterparty is not a differentiating field in many cases. Duplicates could be due to many other fields. Whatever the case may be, we need only one row for each Activity ID with maximum days. And the issue is, there is no unique row identifier.
Hi Amudha_Kumaran ,
Thanks for the clarification. Based on the behavior you’re seeing, it’s clear that Activity_ID, Days, Counterparty, and all other columns can still repeat, meaning there is no unique row identifier anywhere in the model. When that happens, DAX has no way to distinguish those duplicate rows. A measure can only evaluate values at the column level, it cannot see the underlying physical row or row order inside the engine. Because of this, DAX cannot reliably “pick one random row” when two or more rows are completely identical across every available column.
Since you are also working with a Live Connection, calculated columns and calculated tables are not an option. That leaves only two feasible and supportable solutions:
1. Add a surrogate key / row identifier in the source model
2. Adjust the requirement to a higher grain
If you can add that key, I can provide a clean, simplified RANK-based measure that will give you exactly one Max-Days row per Activity_ID.
Hope this helps.
Thank you.
- v-echaithra9 months ago
Community Support
Hi Amudha_Kumaran ,
I just wanted to check if the issue has been resolved on your end, or if you require any further assistance. Kindly share a sample of the data for further investigation.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Best Regards,
Chaithra E.
Thank you
Chaithra E.