Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi
I'm having troubles using Top N to show only the first 10 rows, I know that it works as expected and returns the first 10 values based on the measure. In my case it returns 18 rows.
My dataset is like this and i want to show only the first 10 rows:
When I apply this filter...
... it returns more than 10 rows:
It's ok, it's the normal behaviour of the TOP because it's based on the measure sum_winners, but I only want the first 10 names.I've tried using RANX and TOPN without success, please, anyone has the key?
Thanks in advance,
Regards
Solved! Go to Solution.
Hi @N4gash ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Sum_winners = SUM('Table'[Winners])
Measure =
VAR tmp =
CALCULATETABLE (
VALUES ( 'Table'[Name] ),
TOPN ( 10, ALL ( 'Table' ), [Sum_winners], DESC )
)
VAR _name =
SELECTEDVALUE ( 'Table'[Name] )
RETURN
IF ( _name IN tmp, 1 )
3. add a teable visual with fields and measure, add a measure to visual filter pane and apply
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
There's a tie. Hence you see more than 10 rows. If you want to see only 10 when there are ties, then which 10 do you want to see?
Hi @N4gash ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Sum_winners = SUM('Table'[Winners])
Measure =
VAR tmp =
CALCULATETABLE (
VALUES ( 'Table'[Name] ),
TOPN ( 10, ALL ( 'Table' ), [Sum_winners], DESC )
)
VAR _name =
SELECTEDVALUE ( 'Table'[Name] )
RETURN
IF ( _name IN tmp, 1 )
3. add a teable visual with fields and measure, add a measure to visual filter pane and apply
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
49 | |
41 | |
34 |
User | Count |
---|---|
164 | |
111 | |
62 | |
53 | |
38 |