Make Drop-Down field dependent on each other


I like this solution that I discovered in the documentation as it works for one of the forms I am designing. However, I wanted to know if it was possible to make this dependent upon another field?

I could use a lookup field to simplify my life but the problem with lookup fields is that it doesn't exclude duplicates in the source data. I think this might be a clever workaround to this.

Thank you!