Forum Discussion
Tidying Up Code / Simplifying Code
- 6 years ago
Hi lgs1983 ,
It is the order in which you perform the steps. I would say create a bogus table and work on it by trial basis. Change a column name, then change a type or add a column, then look at doing two column name changes in a row or two type changes, and see how it combines them. A lot of times I will use a form, like add a conditional column to see the syntax, and then change it to my requirement. If you come from a programming background, this is different. Most people just follow the steps. BTW if you used a form to enter something there will be a gear on that step.
That being said, if you are interested in learning M, there are websites and blogs out there. Once you get a handle on the form, it won't be long before you will be modifing your steps. This code doesn't usually go too long, as you just transforming the data.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Hi lgs1983 ,
Power Query does aggregate certain commands if they are together. So changing the name of the column, and changing the type can be done at the end, and will be just two lines of code. You might try that with the other functions as well, but you lose your //notes by month.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Nathaniel_C Thanks. How does one go about grouping these together? What's the structure?
- Nathaniel_C6 years agoCommunity Champion
Hi lgs1983 ,
It is the order in which you perform the steps. I would say create a bogus table and work on it by trial basis. Change a column name, then change a type or add a column, then look at doing two column name changes in a row or two type changes, and see how it combines them. A lot of times I will use a form, like add a conditional column to see the syntax, and then change it to my requirement. If you come from a programming background, this is different. Most people just follow the steps. BTW if you used a form to enter something there will be a gear on that step.
That being said, if you are interested in learning M, there are websites and blogs out there. Once you get a handle on the form, it won't be long before you will be modifing your steps. This code doesn't usually go too long, as you just transforming the data.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel- lgs19836 years agoHelper I
Nathaniel_C Thank you. Will have a play around and do some research into the inner workings of M as going to be useful in the long run.