```r library(dbplyr) con_test <- simulate_mssql() translate_sql(n_distinct(y), con = con_test, vars_group = "x") ``` [Use of DISTINCT is not allowed with the OVER clause in MSSQL. ](https://stackoverflow.com/questions/53517860/count-distinct-over-partition-by-sql)