Hmm, you might take a look a the ordering of the NAs in your data frame. The default of fill is to fill "down" (i.e. fill NAs with values from preceding rows). You could try fill(var, .direction = "downup") which will look both above and below for replacement values, if you know that each client only has one correct gender and race.
Here is an example where the NA in the race column is above the value you want to fill and so you need to specify the direction for it to fill appropriately.
library(tidyverse)
df <- tribble(
~Client, ~Gender, ~Race,
"A", "M", "White",
"A", NA , "White",
"B", "F", NA,
"B", "F", "African American"
)
df %>%
group_by(Client) %>%
fill(Gender, Race) %>%
distinct()
#> # A tibble: 3 x 3
#> # Groups: Client [2]
#> Client Gender Race
#> <chr> <chr> <chr>
#> 1 A M White
#> 2 B F <NA>
#> 3 B F African American
df %>%
group_by(Client) %>%
fill(Gender, Race, .direction = "downup") %>%
distinct()
#> # A tibble: 2 x 3
#> # Groups: Client [2]
#> Client Gender Race
#> <chr> <chr> <chr>
#> 1 A M White
#> 2 B F African American
Created on 2019-09-05 by the reprex package (v0.3.0)