Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
VAIDES
New Member

DAX Table need to relate to other table

Hi,

i have this situation , i have created a TOP N table in this way

 

top 5 jugadores = TOPN(5,
SUMMARIZE(WorldCupPlayers, WorldCupPlayers[NombreJugador], WorldCupPlayers[Iniciales ] ,  "Goles y Penales", dax_medidas[dax_total_goles mas penales]), [Goles y Penales], DESC)
 
the result is something like this
 
VAIDES_0-1662756419683.png

 

 the problem is that i Have a tooltip related to NombreJugador that I need to show, so the question is 
there is a way to RELATE dinamicaly the new "top 5 jugadores"  table with the table  WorldCupPlayers in order to have this tooltip correct ? 
Now is not working
 
this is the page for the tooltip,  refer to tables of the model, the problem is that the new Dax table is not related with any table of the model.
 
VAIDES_1-1662756548395.png

 

 
 
 
 
 
 
 
1 ACCEPTED 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

MarkLaf_0-1662925000635.png

2. Expand filter options of your axis in the filter pane and select the Top N option

MarkLaf_1-1662925118876.png

 

3. Select Top N option, add in the measure you want to rank by, and the desired N

MarkLaf_2-1662925348366.png

 

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:

MarkLaf_3-1662925398318.png

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.

View solution in original post

4 REPLIES 4
MarkLaf
Solution Sage
Solution Sage

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:

MarkLaf_0-1662763320859.png

MarkLaf_1-1662763341279.png

MarkLaf_2-1662763366385.png

 

 

 

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

MarkLaf_0-1662925000635.png

2. Expand filter options of your axis in the filter pane and select the Top N option

MarkLaf_1-1662925118876.png

 

3. Select Top N option, add in the measure you want to rank by, and the desired N

MarkLaf_2-1662925348366.png

 

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:

MarkLaf_3-1662925398318.png

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.

Anonymous
Not applicable

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.

 

 

 

 

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.