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
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! Prices go up Feb. 11th.

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.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.