Forum Discussion
ConnieMaldonado
3 years agoResponsive Resident
CALCULATE 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
3 years agoSuper User
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.
- ConnieMaldonado3 years agoResponsive Resident
Thank you! I always forget to use CALCULATE with count. I appreciate it.