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.
I'm having a brain failure at the moment and I can't quite figure out the logic behind how BI determines the Top N from a list with some duplicates:
Can someone explain how there are 4, when I've asked for the top 3 and there are only 2 distinct values there; 11 & 5?
I assume it's because there are 3 distinct 'location' properties, but this doesn't make sense to me when I've only asked for top 3 Fruit by Qty
Solved! Go to Solution.
@jraward It is expected behavior based on the TOPN DAX function:
"If there is a tie, in order_by values, at the N-th row of the table, then all tied rows are returned. Then, when there are ties at the N-th row the function might return more than n rows."
source: https://msdn.microsoft.com/en-us/library/gg492198.aspx
Hi @jraward,
Can someone explain how there are 4, when I've asked for the top 3 and there are only 2 distinct values there; 11 & 5?
I assume it's because there are 3 distinct 'location' properties, but this doesn't make sense to me when I've only asked for top 3 Fruit by Qty
Eno1978 has already given a good explanation on the behavior of TopN filter. I would like to explain it a little more precisely against your example above.
In your example, you ask for the top 3 Fruit by Qty, so the top 3 Qty should be(11, 11, 5), but there is a tie for 3rd Qty(both olives and lychee have the same Qty of 5), so what to do? Which Fruit should be the third one, olives or lychee? The TopN doesn't know. So both olives and lychee will be return for the 3rd Qty. And that's why there're four furits returned.
Regards
Hi @jraward,
Can someone explain how there are 4, when I've asked for the top 3 and there are only 2 distinct values there; 11 & 5?
I assume it's because there are 3 distinct 'location' properties, but this doesn't make sense to me when I've only asked for top 3 Fruit by Qty
Eno1978 has already given a good explanation on the behavior of TopN filter. I would like to explain it a little more precisely against your example above.
In your example, you ask for the top 3 Fruit by Qty, so the top 3 Qty should be(11, 11, 5), but there is a tie for 3rd Qty(both olives and lychee have the same Qty of 5), so what to do? Which Fruit should be the third one, olives or lychee? The TopN doesn't know. So both olives and lychee will be return for the 3rd Qty. And that's why there're four furits returned.
Regards
@jraward It is expected behavior based on the TOPN DAX function:
"If there is a tie, in order_by values, at the N-th row of the table, then all tied rows are returned. Then, when there are ties at the N-th row the function might return more than n rows."
source: https://msdn.microsoft.com/en-us/library/gg492198.aspx
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.