March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm looking for some help of how to achieve a count of customers across a month where the sum of a couple of columns is 0. In this dataset below, I want to be able to have a table in that simply counts customers where the sum of the Available AND Used is 0 for the customer in the specific Job_ID (aggregating at the job_id level, not the Offer/status level).
In this example, I'd want for Job_Id of 202309, the count to be 1 (customer 345) and when I change the table filter to 202310, I'd expect the count to go to 2 (customers 123 and 345). Seems so simple, but I'm struggling. Please can someone help?
Job_id | CustomerId | Offer | Status | Available | Used |
202309 | 123 | 1a | Expired | 0 | 0 |
202309 | 123 | 1b | Assigned | 50 | 0 |
202309 | 123 | 1c | Expired | 0 | 0 |
202309 | 234 | 1a | Used | 0 | 50 |
202309 | 234 | 1b | Assigned | 100 | 0 |
202309 | 234 | 1c | Assigned | 100 | 0 |
202309 | 345 | 1a | Expired | 0 | 0 |
202309 | 345 | 1b | Expired | 0 | 0 |
202309 | 345 | 1c | Expired | 0 | 0 |
202310 | 123 | 1a | Expired | 0 | 0 |
202310 | 123 | 1b | Expired | 0 | 0 |
202310 | 123 | 1c | Expired | 0 | 0 |
202310 | 234 | 1a | Used | 0 | 50 |
202310 | 234 | 1b | Assigned | 100 | 0 |
202310 | 234 | 1c | Assigned | 100 | 0 |
202310 | 345 | 1a | Expired | 0 | 0 |
202310 | 345 | 1b | Expired | 0 | 0 |
202310 | 345 | 1c | Expired | 0 | 0 |
Solved! Go to Solution.
Try these measures:
Sum Available = SUM ( Jobs[Available] )
Sum Used = SUM ( Jobs[Used] )
Count of Customers with 0 Available/Used =
VAR vTable =
SUMMARIZE ( Jobs, Jobs[Job_id], Jobs[CustomerId] )
VAR vResult =
SUMX ( vTable, IF ( [Sum Available] = 0 && [Sum Used] = 0, 1 ) )
RETURN
vResult
Proud to be a Super User!
Try these measures:
Sum Available = SUM ( Jobs[Available] )
Sum Used = SUM ( Jobs[Used] )
Count of Customers with 0 Available/Used =
VAR vTable =
SUMMARIZE ( Jobs, Jobs[Job_id], Jobs[CustomerId] )
VAR vResult =
SUMX ( vTable, IF ( [Sum Available] = 0 && [Sum Used] = 0, 1 ) )
RETURN
vResult
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
202 | |
137 | |
106 | |
70 | |
68 |