Forum Discussion
Countrows with removefilters not working as it should
I have the following DAX measure to display a row count figure on a card. There are two slicers, one for the Offer Date (using an all dates table) and one for the Status. When selecting a date range in the Offer Date filter, e.g. 01/02/2024-06/02/2024, it should output a figure of 26. When the Status filter is selected as well as the Offer Date filter, e.g. Accepted, it changes the figure to something completely unrelatable (19!), meaning the DAX measure DOES NOT IGNORE other filters as expected.
| ID | Status | OfferDate |
| 29533 | Under Offer | 06/02/2024 |
| 29532 | Under Offer | 06/02/2024 |
| 29531 | Under Offer | 06/02/2024 |
| 29530 | Under Offer | 06/02/2024 |
| 29529 | Under Offer | 06/02/2024 |
| 29528 | Under Offer | 06/02/2024 |
| 29527 | Under Offer | 06/02/2024 |
| 29525 | Under Offer | 05/02/2024 |
| 29523 | Under Offer | 05/02/2024 |
| 29522 | Under Offer | 05/02/2024 |
| 29505 | Under Offer | 05/02/2024 |
| 29504 | Under Offer | 05/02/2024 |
| 29502 | Accepted | 05/02/2024 |
| 29501 | Under Offer | 05/02/2024 |
| 29499 | Under Offer | 05/02/2024 |
| 29498 | Under Offer | 02/02/2024 |
| 29497 | Under Offer | 02/02/2024 |
| 29496 | Under Offer | 02/02/2024 |
| 29493 | Declined | 02/02/2024 |
| 29492 | Accepted | 02/02/2024 |
| 29491 | Under Offer | 01/02/2024 |
| 29490 | Under Offer | 01/02/2024 |
| 29489 | Let | 01/02/2024 |
| 29488 | Declined | 01/02/2024 |
| 29486 | Under Offer | 01/02/2024 |
| 29485 | Accepted | 01/02/2024 |
| 29483 | Under Offer | 31/01/2024 |
| 29482 | Under Offer | 31/01/2024 |
| 29481 | Under Offer | 31/01/2024 |
| 29480 | Under Offer | 31/01/2024 |
| 29479 | Accepted | 31/01/2024 |
| 29478 | Under Offer | 31/01/2024 |
| 29477 | Under Offer | 31/01/2024 |
| 29476 | Under Offer | 31/01/2024 |
| 29475 | Declined | 31/01/2024 |
| 29474 | Under Offer | 31/01/2024 |
| 29473 | Under Offer | 31/01/2024 |
| 29472 | Let | 30/01/2024 |
| 29471 | Under Offer | 30/01/2024 |
| 29470 | Under Offer | 30/01/2024 |
| 29469 | Under Offer | 30/01/2024 |
| 29468 | Accepted | 30/01/2024 |
| 29467 | Under Offer | 30/01/2024 |
| 29466 | Under Offer | 30/01/2024 |
| 29465 | Under Offer | 30/01/2024 |
| 29464 | Under Offer | 30/01/2024 |
| 29463 | Under Offer | 30/01/2024 |
| 29462 | Accepted | 30/01/2024 |
| 29461 | Accepted | 30/01/2024 |
| 29460 | Declined | 30/01/2024 |
| 29459 | Let | 29/01/2024 |
| 29458 | Under Offer | 29/01/2024 |
| 29457 | Under Offer | 29/01/2024 |
| 29456 | Under Offer | 29/01/2024 |
| 29455 | Declined | 29/01/2024 |
| 29454 | Under Offer | 29/01/2024 |
Thank you for any insight 🙂
Thank you for all your replies. I found the following DAX works, I don't know how....but it works!
CALCULATE(CALCULATE(CountRows(AllocationOffersData),AllocationOffersData,Values(AllocationOffersData[Offer Date])), -- Calculates number of rows with the filter for Offer DateREMOVEFILTERS((AllocationOffersData[Offer Status]) -- Clears the filter for Status)
5 Replies
- lbendlin
Super User
Your DAX is a bit redundant. Please explain what you are actualy trying to compute. What is the expected outcome based on the sample data?
- AnonymousNot applicable
Hi Meeshe
I added the date table as a slicer.
You can try the following measure:
countRows = CALCULATE(COUNT('Table'[ID]), FILTER(ALL('Table'), [OfferDate] >= MIN('Date'[Date]) && [OfferDate] <= MAX('Date'[Date])))Is this the result you expect?
Best Regards,
Community Support Team _YuliaxIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- MeesheFrequent Visitor
Thank you so much. The dates would come from user input slicers. I did find some DAX that worked in the end:
CALCULATE(CALCULATE(CountRows(AllocationOffersData),AllocationOffersData,Values(AllocationOffersData[Offer Date])), -- Calculates number of rows with the filter for Offer DateREMOVEFILTERS((AllocationOffersData[Offer Status]) -- Clears the filter for Status)
- MeesheFrequent Visitor
Apologies, I'd written it in a hurry and updated it now - thank you for your response.
- MeesheFrequent Visitor
Thank you for all your replies. I found the following DAX works, I don't know how....but it works!
CALCULATE(CALCULATE(CountRows(AllocationOffersData),AllocationOffersData,Values(AllocationOffersData[Offer Date])), -- Calculates number of rows with the filter for Offer DateREMOVEFILTERS((AllocationOffersData[Offer Status]) -- Clears the filter for Status)