Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Count 0 Values in Table

I have a table with a list of all Accounts & their sales 

 

I need to flag all Accounts what have 0 sales 

 

My Sales Measure is;

var TYQTY = [TY Qty] return

IF(ISBLANK(TYQTY),0,TYQTY)

TY QTY being a simple sum measure - but returns blanks not 0's

 

My current Has No Sales measure is;

CALCULATE(DISTINCTCOUNT('Sale Data'[Account No.]),FILTER('Sale Data',[Store TY Qty]=0))

I have tried both Count & DistinctCount - both return the same result - below

This is counting an account with £14 sales and not flagging those with £0

however this doesnt count the bottom £24 value? 

 

Please advise  

 

2 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    if it's in the same table then you can just go,  but this might be too simple to understand this issue.  Can you share the actual data you using in text format?  Including the columns you are using to derive your measures

     

    CALCULATE(DISTINCTCOUNT('Sale Data'[Account No.]) , sales = 0)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

    How to Get Your Question Answered Quickly  

    Regards,

    Xiaoxin Sheng