Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dynamic Top N slicer (interaction with other Visuals)

Dears,

 

I have created a Top N slicer, which shows me the chosen Top N of Expenses of Assets. I have created a new Table, parameter and a measure "Top N Asset) for the slicer: see below the measure:

 

 

TOP N Asset =
VAR SelectedTop = SELECTEDVALUE('TOP N'[TOP N])
RETURN
SWITCH(TRUE();
SelectedTop = 0;[Expenses USD];
RANKX (
ALLSELECTED(Basis[Asset Name ]);
[Expenses USD]
)
<= SelectedTop;
[Expenses USD]
)
 
 
My Problem now is, that the Table with the Top N dont interagate with the other visuals. If I choose TOP 5 Assets, the table shows me the Top 5 but the other Visuals show me the all. How can I connect the new Table with my imported Table from Excel (called Basis).
 
I tried to make a relationship, but it doesnt work. I think because I dont have a column with the same values. I dont know how to copy the columns from the Table Basis to the new Table.
 
 
Maybe someone have an Idea, how I can solve that problem?
 
Thank you in advance.
  • v-yingjl's avatar
    v-yingjl
    6 years ago

    Hi Anonymous ,

    If you want to use the parameter to interact with other visuals, you can create a calculate column for rank first:

    Rank = RANKX('Basis','Basis'[Expenses USD])

    Then create a control measure, set its value as 1 and put it in the filter of the visual like table:

    Slicer control = 
    IF ( SELECTEDVALUE ( 'Basis'[Rank] ) <= [TOP N Value], 1, 0 )

    The result may like this:

    Here is the sample file that hopes to help you, please try it: PBIX 

    By the way, which confused me is that if you want to show the topn result in the visual, why not create a rank column like the previous mentioned and use it as a slicer directly instead of using what-if parameters to create topN manually.

     

    Best Regards,
    Yingjie Li

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.