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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LS1700
Resolver I
Resolver I

sum by group and count if

Hi, 

 

I would like to have a measure that can tell me how many cusotmer have not sold a single unit in total.

 

The measure ( I think) should do the sum of the sales by customer and then count those who have sales=0.

 

Any idea?

 

in the below case it should be =1.

 

 

CustomerModelSales
AX1
AY0
AZ1
BX1
BY1
BZ1
CY1
DX0

 

 

thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I didn't try this... but it sounds kinda nice...?  🙂

 

Total Sales = SUM(MyTable[Sales])

Losers = CALCULATE(DISTINCTCOUNT(MyTable[Customer]), FILTER(VALUES(MyTable[Customer]), [Total Sales] = 0))

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I didn't try this... but it sounds kinda nice...?  🙂

 

Total Sales = SUM(MyTable[Sales])

Losers = CALCULATE(DISTINCTCOUNT(MyTable[Customer]), FILTER(VALUES(MyTable[Customer]), [Total Sales] = 0))

 

 

Thanks! Completely solved my problem!

Brilliant! Works like a charm and JUST what I was looking for....

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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