You can nuance it with "grâce à X" instead of "à cause de X". Grâce à is more positive (you thank X), whereas à cause de is more negativie (you blame X). I am the first at class because of you/thanks to you -> Je suis le premier de la classe grâce à vous. I am the first at class because of you/I blame you -> Je suis le premier de la classe à cause de vous.
Both because of and thanks to can be used for good and bad reasons. Obviously, saying I am bottom of the class thanks to you has a strong dose of sarcasm - no thanks are really meant - but it is very common.
In fact, I suggest you avoid the bald phrase "thanks to you", and replace it with something more explicit such as "thanks to your teaching" or "because of your help".