Average by category and condition

Hey all,
I’m trying to compute averages by category for only those records with non-zero ratings. Here’s the data -

I’ve attempted using avgOver -


…but by default it always gives the total average (in red). I don’t want to add an explicit filter in quicksight to remove the 0s. Please suggest

Just solved it -
avgOver(ifelse(RATING<>0, RATING, null), [INCIDENT_NUM], PRE_AGG).

Feel free to suggest if there’s a different/better way to do this