Forum Discussion

Mr_Glister's avatar
Mr_Glister
Advocate II
2 years ago
Solved

DAX distinct count with filter condition

I have an issue with something that I thought would be easy.    Below is a sample of my data. I would want to create a DAX measure that counts the number of companies (distinct!) that have >= 10 It...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Mr_Glister ,

     

    I made simple samples and you can check the results below:

    Total Count = var _t = ADDCOLUMNS('Table',"total",SUMX(FILTER(ALL('Table'),[Week]=EARLIER([Week])&&[Company]=EARLIER([Company])),[Item sold]))
    RETURN CALCULATE(DISTINCTCOUNT([Company]),FILTER(_t,[Total]>=10))

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.