cancel
Showing results for 
Search instead for 
Did you mean: 
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
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors