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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

8 REPLIES 8
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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@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

The problem might be related to specifying the correct column filter to keep. In my case, I initially tried to keep the filter for the column in the table where I was performing the calculation. However, this approach did not work, as the column filter was merely passed down from a table higher up in the relationship hierarchy.

It only worked when I specified the column from a table higher up in the relationship hierarchy. This higher-level table was the one actually being filtered, and it just passed the filter down via the relationship between both tables.

@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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.