The problem of leveling the floor of the bathroom has to be viewed in two aspects. If the floor has an access from below like a basement or a sub floor then it will be possible to level it by placing the shims.
However, in case there is no sub floor or other ways to access the floor from below then a self-leveling product has to be used. These products are mixed with water and raked on the floor. Over a period, it will find its own level. The self-leveling products are highly expensive but its high level of utility is worth the cost. Very little time is consumed when these products are used.
Wonder board or hardibacker backer needs to be installed over the raked floor. It is also essential to install felt roofing on the wonder board so that it acts like a moisture absorber. Above this roofing the sub flooring should be done.