The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I needed to get the total count of records based on specific criteria while completely ignoring a filter in the "Filters on this page" section of the Filter pane. First, here's a sample of my data:
Record ID | Customer | Status | Name | Type | Date |
000001 | Customer A | Complete | A | Intake | 12/31/2022 |
000002 | Customer A | Complete | B | Outbound | 1/1/2023 |
000003 | Customer A | Adjusted | C | Process | 4/1/2024 |
000004 | Customer A | Complete | Inbound | 4/4/2024 | |
000005 | Customer A | Pending | D | Intake | 1/1/2025 |
000006 | Customer A | Pending | E | Outbound | 2/28/2025 |
000007 | Customer B | Complete | Process | 5/1/2025 | |
000008 | Customer B | Adjusted | F | Inbound | 12/31/2022 |
000009 | Customer B | Complete | G | Intake | 1/1/2023 |
000010 | Customer B | Pending | H | Outbound | 4/1/2024 |
000011 | Customer B | Pending | I | Process | 4/4/2024 |
000012 | Customer B | Adjusted | J | Inbound | 1/1/2025 |
000013 | Customer C | Pending | Intake | 2/28/2025 | |
000014 | Customer C | Pending | K | Outbound | 12/31/2022 |
000015 | Customer D | Complete | L | Process | 1/1/2023 |
000016 | Customer D | Complete | M | Inbound | 4/1/2024 |
000017 | Customer D | Pending | N | Intake | 4/4/2024 |
000018 | Customer D | Adjusted | Outbound | 1/1/2025 | |
000019 | Customer D | Pending | O | Process | 2/28/2025 |
000020 | Customer D | Pending | Inbound | 4/15/2025 |
I'm trying to count the number of Record ID's for all Customers (i.e., ignoring the page level filter where the customer is selected) where:
There is also a Date slicer on the page that is supposed to affect the count. I tried the following DAX formula, but the "all customer" total changes whenever I select a different Customer on the page level filter:
Count_AllCustomers = CALCULATE(DISTINCTCOUNT(Table1[Record ID]),FILTER(ALLEXCEPT(Table1,Table1[Date]),(Table1[Status]="Complete"||Table1[Status]="Adjusted")&&Table1[Name]<>""&&NOT(CONTAINSSTRING(Table1[Type],"bound"))))
Any suggestions on how to change this so that the total count only changes if the Date slicer is adjusted and not when the Customer is changed?
Solved! Go to Solution.
Actually, my original DAX formula was giving me the errant totals. I had to edit the formula as I entered it incorrectly in my original post (that's what my "corrected" post was about). It turns out the issue was due to the "ALLEXCEPT(Table1,Table1[Date])" portion of the formula. Even though my date slicer didn't change when I would select a new Customer on the page filter, selecting a Customer caused my formula to only consider records in between the max and min dates associated with that customer. I solved the problem by using an unconnected Date table for the slicer and adjusted my formula to use the max and min dates shown in the slicer.
Hi @LLGreen ,
We noticed we haven't received a response from you yet, so we wanted to follow up and ensure the solution we provided addressed your issue. If you require any further assistance or have additional questions, please let us know.
Your feedback is valuable to us, and we look forward to hearing from you soon.
Thanks..
Actually, my original DAX formula was giving me the errant totals. I had to edit the formula as I entered it incorrectly in my original post (that's what my "corrected" post was about). It turns out the issue was due to the "ALLEXCEPT(Table1,Table1[Date])" portion of the formula. Even though my date slicer didn't change when I would select a new Customer on the page filter, selecting a Customer caused my formula to only consider records in between the max and min dates associated with that customer. I solved the problem by using an unconnected Date table for the slicer and adjusted my formula to use the max and min dates shown in the slicer.
Hi @LLGreen ,
Thank you for being a part of the Microsoft Fabric community.
I tested your scenario using the DAX formula you shared, and it worked correctly on my end as well. Could you confirm if the DAX solution resolved your issue?
If the problem persists, could you provide more details about your specific requirements? Sharing information such as the expected vs. actual results, any specific errors encountered, or situations where the formula fails would greatly help in diagnosing the issue more effectively.
Corrected DAX formula. Sorry about that.