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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ppichet
New Member

ALLSELECTED except top 5 in visual level filter?

I'm trying to make a table with sales comparing to total sales in percentage. This table is showing top 5 SKUs by sales by using the visual level filter.


However, when I compare the sales to total sales, I want to compare with all of the SKUs, not just the top 5. Also, this should still works with other slicers. Please find the example below:

 

Raw Data

Client NameSKUSKU NameMonthSales
AA11AAAJan50
AA22BBBJan30
AA33CCCJan10
AA44DDDJan55
AA55EEEJan60
AA66FFFJan80
AA77GGGJan20
AA88HHHJan100
AA11AAAFeb30
AA22BBBFeb60
AA33CCCFeb80
AA44DDDFeb90
AA55EEEFeb120
AA66FFFFeb50
AA77GGGFeb10
AA88HHHFeb5



So the result table would shows something like this (when user did not use any slicer)

SKUSKU NameSalesTotal Sales% Total Sales
A55EEE18085521%
A44DDD14585517%
A66FFF13085515%
A88HHH10585512%
A33CCC9585511%

 

And this should be the result if the user select only the month of Feb

SKUSKU NameSalesTotal Sales% Total Sales
A55EEE12044527%
A44DDD9044520%
A33FFF8044518%
A22HHH6044513%
A66CCC5044511%

 

If I use ALL(), I will always get all the month even when user select only Feb, If I use ALLSELECTED(), I will only got the total sales of the top 5 shown, so the second table the total sales will be 120+90+80+60+50 = 400 instead of 445.

 

Any advice on how can I get Total Sales and % Total Sales to reflect what I want?

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @ppichet,

Based on my test, you could refer to below formula:

Total sales = CALCULATE(SUM(Table1[Sales]),ALLEXCEPT(Table1,Table1[Month]))
%Total sales = SUM(Table1[Sales])/CALCULATE(SUM(Table1[Sales]),ALLEXCEPT(Table1,Table1[Month]))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
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-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @ppichet,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @ppichet,

Based on my test, you could refer to below formula:

Total sales = CALCULATE(SUM(Table1[Sales]),ALLEXCEPT(Table1,Table1[Month]))
%Total sales = SUM(Table1[Sales])/CALCULATE(SUM(Table1[Sales]),ALLEXCEPT(Table1,Table1[Month]))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors