Yes, you can be. The question in a DWI case is not whether the substance you were taking is legal or not, but whether it intoxicated you or not. You can be convicted of DWI even for being under the influence of a legal prescription drug.