Does custom expression support counting fields that meet specific conditions?

Does custom expression support counting fields that meet specific conditions? eg:COUNT(DISTINCT CASE WHEN [field]=1 THEN [field] ELSE NULL END

Check out the expression countif() function CountIf

It doesn't seem to work. How can countif be combined with distinct because it still needs to be deduplicated

Not sure if you can combine them like that sorry.

Could you do your condition as the filter then your count distinct in the summary? i.e.:

Depends what you're trying to get out. Sometimes you just need to do it in SQL. I find doing the SQL as a model, then using that in the query builder works quite well.