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

Be 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

Reply
lidsurfer
New Member

Count of customers with 0 Available/Used across the Month

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_idCustomerIdOfferStatusAvailableUsed
2023091231aExpired00
2023091231bAssigned500
2023091231cExpired00
2023092341aUsed050
2023092341bAssigned1000
2023092341cAssigned1000
2023093451aExpired00
2023093451bExpired00
2023093451cExpired00
2023101231aExpired00
2023101231bExpired00
2023101231cExpired00
2023102341aUsed050
2023102341bAssigned1000
2023102341cAssigned1000
2023103451aExpired00
2023103451bExpired00
2023103451cExpired00
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@lidsurfer,

 

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

 

DataInsights_1-1701439952092.png

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
lidsurfer
New Member

Thank you @DataInsights that has worked a treat.   

DataInsights
Super User
Super User

@lidsurfer,

 

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

 

DataInsights_1-1701439952092.png

 





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

Proud to be a Super User!




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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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