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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
BVdL
Regular Visitor

exclude a value or measure from a slicer

Hello

 

I'm currently working on a tool to calculate different pieces of information for customer sales with one customer slicer. I want to calculate the percentage of a specific customer's total orders compared to the grand total of all customer's orders. However, if I use the slicer to select the specific customer, the grand total is automaticly changed to that sole customer as well, consequently, the formula always renders 100%.

 

Say i have the following:

 

Customer A  20 kg

Customer B   25 kg

Customer C  15 kg

 

when I put the slicer on 'Customer A', the calculation gives me 20/20 --> 100%

I need it to give me 20/60 --> 33,33%

 

Is there any way to work around the slicer selection?

 

Thanks!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Your measure should look like this

 

=SUM(Data[Sold])/CALCULATE(SUM(Data[Sold]),ALL(Data[Customer]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Your measure should look like this

 

=SUM(Data[Sold])/CALCULATE(SUM(Data[Sold]),ALL(Data[Customer]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur

 

Thanks! this did the trick for the first part! 

I need to exclude 1 particular customer ( in a data set of 50 customers, I need to exclude 1 from the total count.), If I add a second filter with ALLEXCEPT, I still need to create a column that filters out that one customer. I tried adding a FILTER on the ALLEXCEPT as shown below, but it doesn't wat to filter out the customer's name. Any other way to filter this?

 

=SUM(Data[Sold])/CALCULATE(SUM(Data[Sold]),ALL(Data[Customer]),ALLEXCEPT(FILTER(Data[Customer],"Customer A"))

 

Thanks!

Hi,

 

Try this

 

  1. Create a slicer and uncheck Customer A from there
  2. Write this measure

 

=SUM(Data[Sold])/CALCULATE(SUM(Data[Sold]),FILTER(ALL(Data[Customer])))

 

or

 

=SUM(Data[Sold])/CALCULATE(SUM(Data[Sold]),ALLSELECTED(Data[Customer]))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
pxg08680
Resolver III
Resolver III

@BVdL

Create a new column as shown below

 

Column = DIVIDE(Customer[Value],SUM(Customer[Value])). Select the new column and go to modelling and select Format: Percentage.

 

a1.PNG

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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