Forum Discussion
ConnieMaldonado
Responsive Resident
3 years agoCALCULATE Counts with Conditions
Hello! I have what I think is a simple calculation, but I can't get it to work correctly. I have a table with SKU items and efficiency rates. Efficiency rate is the expected duration of the ...
- 3 years ago
You can try three measures (or just one if you want to use variables)
Success =CALCULATE(COUNT(efficiencyTable[Item_Name]),FILTER(efficiencyTable, NOT(ISBLANK([SKU_Efficiency])) && [SKU_Efficiency] <> 0 && [SKU_Efficiency] >=1))Total (Non-Zero) =CALCULATE(COUNT(efficiencyTable[Item_Name]),FILTER(efficiencyTable, NOT(ISBLANK([SKU_Efficiency])) && [SKU_Efficiency] <> 0))Success Rate =DIVIDE([Success],[Total (Non-Zero)],0)I ended up with the following result using your data.
jgeddes
Super User
3 years agoYou can try three measures (or just one if you want to use variables)
Success =
CALCULATE(
COUNT(efficiencyTable[Item_Name]),
FILTER(efficiencyTable, NOT(ISBLANK([SKU_Efficiency])) && [SKU_Efficiency] <> 0 && [SKU_Efficiency] >=1)
)
Total (Non-Zero) =
CALCULATE(
COUNT(efficiencyTable[Item_Name]),
FILTER(efficiencyTable, NOT(ISBLANK([SKU_Efficiency])) && [SKU_Efficiency] <> 0)
)
Success Rate =
DIVIDE(
[Success],
[Total (Non-Zero)],
0
)
I ended up with the following result using your data.
ConnieMaldonado
Responsive Resident
3 years agoThank you! I always forget to use CALCULATE with count. I appreciate it.