Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
i have this situation , i have created a TOP N table in this way
Solved! Go to Solution.
Revisiting this, I would be remiss if I didn't mention the even more straightforward way to do this by setting a top N filter straight through the UI.
1. Select your visual and open Filters pane
2. Expand filter options of your axis in the filter pane and select the Top N option
3. Select Top N option, add in the measure you want to rank by, and the desired N
Same output as what I provided above. Probably the better solution for its simplicity unless you need the dynamic N functionality I mentioned at the end of my post:
Again, going this route may circumvent your issues because you aren't creating a dynamic table just for the Top N functionality, so you can leverage the measures and relationships you've already set up.
You may want to avoid the issue entirely by using RANKX to filter your measure rather than construct a dynamic table. You can then use whatever already existing fields/measures related to WorldCupPlayers. This is just a guess given it's not clear exactly what you model looks like, but you can try something like this:
top 5 jugadores_m =
VAR _all_m =
GENERATE(
ALL( WorldCupPlayers[NombreJugador] ),
ROW( "m", [dax_total_goles mas penales] )
)
VAR _this_m = [dax_total_goles mas penales]
VAR _m_rank = RANKX( _all_m, [m], _this_m )
VAR _rank_cut = 5
VAR output =
CALCULATE(
[dax_total_goles mas penales],
FILTER( WorldCupPlayers, _m_rank <= _rank_cut )
)
RETURN
output
If you have something like the above working, you could then take it a step further and use a numeric range parameter instead of hard-entering 5, so the user can pick top X from a slicer. E.g. example output with dummy data:
thanks a lot i will try this solution!
Revisiting this, I would be remiss if I didn't mention the even more straightforward way to do this by setting a top N filter straight through the UI.
1. Select your visual and open Filters pane
2. Expand filter options of your axis in the filter pane and select the Top N option
3. Select Top N option, add in the measure you want to rank by, and the desired N
Same output as what I provided above. Probably the better solution for its simplicity unless you need the dynamic N functionality I mentioned at the end of my post:
Again, going this route may circumvent your issues because you aren't creating a dynamic table just for the Top N functionality, so you can leverage the measures and relationships you've already set up.
Hi,
If you want to use Related Function your table has to be related with another.
And has to be a relationship 1 to n or 1 to 1.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
23 | |
21 | |
20 | |
13 | |
12 |
User | Count |
---|---|
41 | |
32 | |
23 | |
23 | |
22 |