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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
szub
Helper III
Helper III

Need measure to ignore all but one filter

Hello,

 

I need to do a count of serial numbers and I want the count to only be affected by the date range entered in slicer, which is the sale date.  All other filters I want it to ignore (and there a quite a few).  I need to be able to use the measure to then create another measure to divide the total number of serial numbers that had a service claim by the number of serial numbers sold in the sale date range.  I am finding a lot on how to ignore a specific filter, but not on how to only have one filter affect the measure.

 

Hope this makes sense.

 

Thank you!

1 ACCEPTED SOLUTION

When you have everything one table things sometimes becoming challenging.

Create a calendar table and join sales date with and then try allexcept

Serial Count = CALCULATE(COUNT('Sales'[SALES SERIAL_NBR]),ALLEXCEPT('Date','Date'[DATE]))

 

Or you can use interaction to remove other filters to pass

Interactions.png

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

7 REPLIES 7
Tahreem24
Super User
Super User

@szub ,

 

In order to ignore all filter except for one so for this you can utilize the ALLEXCEPT dax function.

 

Don't forget to give thumbs up 👍and accept this as a solution if it helped you.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 ,

 

Thank you for your quick reply.  I tried using ALLEXCEPT, but it is still counting values based on filters other than the sale date.   This is the formula I used: 

Serial Count = CALCULATE(COUNT('Sales'[SALES SERIAL_NBR]),ALLEXCEPT('Sales','Sales'[SELLDATE]))
 
Thank you

When you have everything one table things sometimes becoming challenging.

Create a calendar table and join sales date with and then try allexcept

Serial Count = CALCULATE(COUNT('Sales'[SALES SERIAL_NBR]),ALLEXCEPT('Date','Date'[DATE]))

 

Or you can use interaction to remove other filters to pass

Interactions.png

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

@amitchandak 

Thank you for the suggestion, but it is still not giving me the incorrect count.  I did use the edit interactions for a card that is displaying the correct number, I just can't seem to get the same count to use in a measurement.

Hi @szub,

 

 ALLEXCEPT ignores all other columns in a table except for the one/s explicitly specified in the formula. So in your case, the measure will count all 'Sales'[SALES SERIAL_NBR] for each unique 'Sales'[SELLDATE]. Even if you filter it by another filed from Sales table, it will still return the count for a particular sell date or dates.  

 

To make this clearer, please post a sample data (not an image, either a link to an excel file or just paste a sample table) and your expected output.  Also, are you filtering the report by another column from a related table? If so, this must be taken into account. 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian 

 

Here is some sample data for the sales table.  Yes, I have a relationship to another table that has filters in my model (see 2nd table).

BRANDInvoice DateSales #Model #ITEM_DESCQtySERIAL_NBR
WIDGIT5/20/2019S123Model 1Unit XYZ1Serial 1
WIDGIT11/29/2017S124Model 2Unit XYZ1Serial 2
WIDGIT11/29/2017S125Model 3Unit XYZ1Serial 3
WIDGIT9/20/2019S126Model 4Unit XYZ1Serial 4
WIDGIT9/20/2019S127Model 5Unit XYZ1Serial 5
WIDGIT10/15/2019S128Model 6Unit XYZ1Serial 6

 

Here is a sample of claim data that has a many to one relationship to the serial number in the sales table.

Claim #Claim DateClaim TypeStatusSerial #Svc AgentCustomerFail DateRepair Date# TripsLaborPartsOtherTotal
Claim 110/21/2019WarrantyPaidSerial 1SA1Cust110/15/201910/15/20191237.200237.16
Claim 212/22/2018InstallationPaidSerial 2SA2Cust212/13/201812/13/20181216.6020.49237.12
Claim 35/17/2019WarrantyPaidSerial 2SA2Cust25/14/20195/14/2019125000250
Claim 48/22/2019WarrantyPaidSerial 2SA2Cust28/16/20198/16/20191286.247.564.76338.48
Claim 59/1/2019InstallationPaidSerial 3SA5Cust38/16/20198/16/20191629.2510511190.12
Claim 610/1/2019WarrantyPaidSerial 3SA5Cust310/1/201910/1/2019110020050350

 

Thank you

@szub ,

 

Something like below. In this case I want to keep Date filter but ignore all filters.

Measure = CALCULATE(COUNT('Table'[Values]),ALLEXCEPT('Table','Table'[Date]))
 
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.