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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PeterStuhr
Helper V
Helper V

Slicer to affect "topN + other"

Hi all,

 

I have a Products table and a Sales table, which is related based on productID.

 

I want to do a "Top 10 + Others", based on sales. BUT I need to be able to make the slicer affect it, as we need to see it per company in our sales table.

 

How I did it:

 

Made a calculated column in the Products table to rank, based on sales:

 

Sales TopN+Others =
VAR RankbySales = RANKX(ALL(Products); [Sales];;DESC)
return
IF(RankbySales <=10;Products[Product];"Others")
 
This does in fact rank the top 10 products in a new table. But if I slice on company, it doesnt affect the ranking. So it is not dynamic based on slicer filters.
 
Can that be achieved?
1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @PeterStuhr ,

 

The measure is dynamic but the calculated columns are computed during the database processing and then stored in the model. So In your scenario, we cannot make the calculated column dynamically by slicer.

 

We can try to create a measure in table visual meet your requirement:

 

Sales TopN+Others =
VAR RankbySales =
    RANKX ( ALLSELECTED ( Products ); [Sales];; DESC )
RETURN
    IF ( RankbySales <= 10; RankbySales; "Others" )

 


Best regards,

 

Community Support Team _ Dong 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

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @PeterStuhr ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @PeterStuhr ,

 

The measure is dynamic but the calculated columns are computed during the database processing and then stored in the model. So In your scenario, we cannot make the calculated column dynamically by slicer.

 

We can try to create a measure in table visual meet your requirement:

 

Sales TopN+Others =
VAR RankbySales =
    RANKX ( ALLSELECTED ( Products ); [Sales];; DESC )
RETURN
    IF ( RankbySales <= 10; RankbySales; "Others" )

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.