Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.