Forum Discussion
finding values not zero
Hi,
Try this
=CALCULATE(DISTINCTCOUNT(Data[id]),Data[Gross]>0)
Select any year/Supplier via the Filter section/slicer.
I have assumed that id is the Customer id.
Not quite the solution to my issue, likely due to my poor explanation.
I have made some progress (I think).
ADF = COUNTAX(FILTER(gross_sales,[Sales 2017]>0),[Gross])
Sales 2017 = CALCULATE(SUM(gross_sales[Gross]),gross_sales[year]=2017)
along with manufacturer_id, and user_id, I have this sample table. In effect, I am looking to count the number of items in column ADF (the values are the actual number of transaction to comprise the Sales 2017 value).
| manufacturer_id | user_id | Sales 2017 | ADF |
| 102 | 73 | $0 | |
| 102 | 74 | $6,008 | 3 |
| 102 | 75 | $0 | |
| 102 | 76 | $14,972 | 7 |
| 102 | 77 | $4,934 | 10 |
| 102 | 78 | $65,662 | 12 |
| 102 | 79 | $0 | |
| 102 | 80 | $0 | |
| 102 | 82 | $0 | |
| 102 | 83 | $0 | |
| 102 | 84 | $1,325 | 4 |
| 102 | 85 | $0 | |
| 102 | 86 | $9,487 | 10 |
The answer I am looking for in this sample, would be 6.
I very appreciate your time, with many thanks.
- Ashish_Mathur8 years agoSuper User
Hi,
=CALCULATE(COUNTA(Data[user_id]),Data[Sales 2017]>0)
Does this work?
- Anonymous8 years agoNot applicable
Sorry no.
Dealer_Count = CALCULATE(COUNTA(gross_sales[user_id]),gross_sales[Sales 2017] > 0) creates this message:
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Thanks for your ongoing assistance.
Frank
- Ashish_Mathur8 years agoSuper User
Hi,
It works absolutely fine.