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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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