Forum Discussion

Roseventura's avatar
Roseventura
Icon for Responsive Resident rankResponsive Resident
4 years ago
Solved

REMOVEFILTERS() not working as expected

Hi,

 

I'm trying to create a measure that removes the Customer filter so I can show an overall % sold by part.

 

In this example for a specific part:

 

2 customers purchased this part.  Total Qty sold = 45

My users want me to show not only the % sold against OH Qty by Customer, but also the OVERALL % sold for that part for all customers.)

 

They still want to be able to filter by part and by customer, but they want a % column which looks at the overall sold and compares that with the OH Qty.

 

CUSTOMERPart Qty Sold
AIRBUSABS0596S005 20
AIRBUSABS0596S005 10
SAFRANABS0596S005 5
SAFRANABS0596S005 5
SAFRANABS0596S005 5
   45

 

The measure I need would return (in this example) Total Sold 45 so I can calculate % OH to Overall Sold (35%)

 

CustomerPartQty SoldOH % OH to Sold to CustTotal Sold% OH to Overall Sold
AirbusABS0596S0053013023.1%4535%
SafranABS0596S0051513011.5%4535%

 

I tried this measure:

 

Total Overall Forecast Qty = calculate( [Total Qty] , REMOVEFILTERS( Customer[CUSTOMER] ) )
 
but as soon as I select a customer from the filter, it shows the Qty based on the filtered Customer.
 
What am I missing?
 
Rose
 
  • I figured it out.  The measure "Total Overall Qty" returns the 45 which is the total sold for that part to ALL customers:  

     

    Total Overall Qty =
         calculate( [Total Qty] ,
            ALLEXCEPT(Customer, Customer[CUSTOMER] ) )
     
    Total Qty = calculate(sumx(Sales, [QUANTITY]) )
     
     
     
    Customer Mil Spec Qty UOM OH Qty Overall Sold % OH vs Sold
    SAFRAN ABS0596S005 30 EACH 13 45 28.89%
     
     

3 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Roseventura 

     

    You can try the following methods.

    Total Sold = CALCULATE(SUM('Table'[Qty Sold]),ALL('Table'))
    % OH to Overall Sold = DIVIDE([Total Sold],SUM('Table'[OH]))

    At this point[Total Sold] can ignore any filters.

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Roseventura's avatar
      Roseventura
      Icon for Responsive Resident rankResponsive Resident

      Unfortunately I tried this approach.  ALL() gives me the total Qty of EVERY part for EVERY Customer in the ENTIRE table (see below).  I need the measure to give me a total Qty for each part, but for ALL Customers who purchased that part, ignoring any Customer filter.

       

       

       

  • Roseventura's avatar
    Roseventura
    Icon for Responsive Resident rankResponsive Resident

    I figured it out.  The measure "Total Overall Qty" returns the 45 which is the total sold for that part to ALL customers:  

     

    Total Overall Qty =
         calculate( [Total Qty] ,
            ALLEXCEPT(Customer, Customer[CUSTOMER] ) )
     
    Total Qty = calculate(sumx(Sales, [QUANTITY]) )
     
     
     
    Customer Mil Spec Qty UOM OH Qty Overall Sold % OH vs Sold
    SAFRAN ABS0596S005 30 EACH 13 45 28.89%