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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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