cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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:

 

Slicer Code.JPG

 

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.
 
Basis Table.JPG
 
Maybe someone have an Idea, how I can solve that problem?
 
Thank you in advance.
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Dynamic Top N slicer (interaction with other Visuals)

Hi @Albert_Lind ,

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:

rank result.png

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.

View solution in original post

5 REPLIES 5
Microsoft
Microsoft

Re: Dynamic Top N slicer (interaction with other Visuals)

Hi @Albert_Lind ,

If you want to copy some columns from one table, you can create a calculate table like this:

Copy table =
SUMMARIZE ( 'Table', 'Table'[column1], 'Table'[column2] )

Please refer: https://docs.microsoft.com/en-us/dax/summarize-function-dax 

If not help, could you please consider provide a dummy .pbix or sample data for further discussion?

 

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.

 

Highlighted
Helper I
Helper I

Re: Dynamic Top N slicer (interaction with other Visuals)

Hi @v-yingjl

 

I have already tried that. The problem is, that then the Parameter doesnt work.

 

I also tried with "addclolumn" in the parameter it doesnt work to, maybe I did it wrong.

Highlighted
Helper I
Helper I

Re: Dynamic Top N slicer (interaction with other Visuals)

Hi @v-yingjl 

below you can see a smal version of my Datatable (Basis).

 

CountryCategoryAsset NameExpenses USDFEEActivationMedia
GermanyFootballAccor Hotels Arena 2000200000
BelgiumVenueOlympia3000200010000
GBMusicZenith4000100020001000
GermanyFootballFootball cup5000250025000
FranceVenueFederation Française de Football6000200020002000
FranceMusicParis Saint-Germain7000300020002000
FranceOtherParis Other8000200040002000

 

The other Table is parameter (What if): Generateseries(0;20;1) + the measure from my first post.

 

I want a slicer that shows me the Top N of Assets. I got it, but the slicer or the Table dont interact with the other visuals. The others show always all Assets, not the TOP N.

 

Is that enough?

 

Thank you, 

 

Albert

 

Highlighted
Microsoft
Microsoft

Re: Dynamic Top N slicer (interaction with other Visuals)

Hi @Albert_Lind ,

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:

rank result.png

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.

View solution in original post

Highlighted
Helper I
Helper I

Re: Dynamic Top N slicer (interaction with other Visuals)

Hi @v-yingjl ,

 

Thank you for your help.

 

I tried the first approach, but it does not work correctly with my Data. When I choose 0, it shows me 3. Maybe the 3 Assets are wrong data. I dont know, why it shows me 3. If I choose 1, it shows me 4. So I think it something with the data.

 

The second approach is much more easier and makes more sense and it works. Thank you.

 

If you have a tip why the first approach may not work, it would be great. I am just interested, why.

 

Thank you 

 

Albert

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors