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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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