I tried both versions
I believe Key metrics expressions must be measures.
Your current formula is resulting in a row-level calculation, not an aggregated value.
To fix it, you might need to wrap the formula in aggregation function like SUM().
Try:
SUM(CASE WHEN CAST(PER_ASG_PERCENTUALE_INCARICO_ AS INT) > 0 THEN 1 ELSE 0 END)
The formula should be:
CASE WHEN condition THEN expression ELSE expression END
Hi @Benjamin Arnulf-Oracle , unfortunately it seems not :(