How to unflatten data using M?

Level: Advanced
Why is it important to have a good data model? Using advanced M techniques it is possible to create a star schema model from a flat table.