Normally when you're healthy your poop should actually sink to the bottom of the toilet after you poop because the contents of your poop are denser than water.
Floating poop that is also greasy and are foul smelling may be due to severe malabsorption, particularly if you are losing weight when you have the greasy, foul smelly floating poop.
Another cause of floating poop is gastrointestinal infections which is not as severe as the malabsorption and even sometimes a change in your diet can cause your poop to float.
If your poop is just floating due to a change in diet and when you poop later and it sinks then usually nothing is wrong with you.
If your poop continues to float then you should speak with your doctor about the cause as it could be something severe that needs fixed.
Sometimes floating poop is okay and sometimes it's not as it depends on why the poop is floating.