Yes, you can do that. But all it does it loads the entire report, and then filters it once loaded.
What I would like to do is change the entire query based on a parameter.
In PowerBI Desktop a Parameters feature seems to exist which suggests this is possible, but I can't see that if this is available for use by the Embedded APIs