Why You Should Learn PowerQuery M as Your First Programming Language?

Kenneth Infante
4 min readFeb 23, 2020
Source: excelcampus.com

I’ve recently written a book on PowerQuery Guide to Pandas.

In my book, I’ve explain Pandas concepts using PowerQuery. I’ve also indicated why data professionals should learn Python/Pandas.

But I think I haven’t explained why learn PowerQuery in the first place?

Sure, learning other languages first is possible but I think PowerQuery M has its place as a beginner’s language.

Here are the reasons I could think of:

  • Built-right into Excel

Since it is built right into Excel and PowerBI, there’s no need to install any additional software. If you update Excel or PowerBI, PowerQuery will be updated too.

If any updates break your solution, you can just undo and redo steps with ease to arrive at the same solution. PowerQuery will update the code for you.

  • Your data is completely safe

PowerQuery works on a copy of your data. Hence, you can be worry-free in coding your solution. You can always return to your original, untouched data.

Also, it allows you to undo and redo steps with ease hence you’re free to make mistakes as you learn. Your data is in good hands.

  • PowerQuery M language is more fun to use than VBA

VBA is the first programming that is available right into Excel and still being used today. However, for anyone with experience with VBA, the quirks of the language (array that is fixed in length by default, dicts to be imported from another library, etc.) coupled with outdated editor makes it frustrating to use.

PowerQuery is different. It is a well-thought and easier-to-use language. And the IntelliSense just works!

Power Intellisense feature
  • It encourages the “hacker” mindset

The mix of GUI code generation and editing allows the user to try different combinations of data transformations steps. Hence, the user can hack around the code until their data looks right.

Also, the user can arrive at a quicker solution faster because of this mix hence enforcing the hacker’s mantra “Make it work, make it fast/beautiful”. The beginner can make the solution work using the GUIs then jump into editing mode to make the code better — removing unnecessary or duplicate steps.

  • Allows user to focus on one thing
Photo by Paul Skorupskas on Unsplash

Programming languages like Python, Java, etc. are general-purpose programming languages. This means that they can be used for web applications, building GUI, data science, scraping, and so much more.

This is great as a whole but for beginners, they might be tempted to jump from one area to another without solidifying first their knowledge in one. And with the abundance of tutorials out there, it is really possible.

PowerQuery is made only for data manipulation and transformation within Excel and PowerBI. This limitation is actually a blessing for a complete novice in programming.

This forces them to master one programming language until such time that they are ready to move on to other languages.

  • Allows user to achieve programming self-sufficiency
Achieving self-sufficiency — until there’s no need for training wheels!

The ultimate goal when learning programming is to achieve programming self-sufficiency. This means that the user more or less:

  • Is comfortable seeing and reading code — knows that dealing with code will not break your computer and is very forgiving
  • Knows to arrive at a solution in his/her own — may involve searching around StackOverflow, Googling a lot, or using the built-in help
  • Knows how to setup his/own tools — again programming has evolved to the point that the tools are abundant and are very easy to use

These are critical in learning multiple languages.

PowerQuery has all these. Because of the code corresponds to each step, the code is easier to read. Also, the code generation can serve as “help” or documentation on how to use certain functions. There’s no need to setup any external tools too.

Hence, learning PowerQuery will give any beginner the confidence to learn other languages later on.

  • Breaks the misconceptions about programmers

Any beginner has this feeling that the programmers are the ones that wear hoodies coding all night in the command prompt in a dark room with multiple glowing screens.

This is far from the truth.

With low-code tools like PowerQuery, anyone can code in their pajamas! This makes it easier to get started without all these stereotypes.

Final Word

I really believe that any professionals (accountants, etc) should learn how to code. Coming up from an accounting background, there’s just a lot of tasks that can be done easier with programming.

Now, with PowerQuery, it’s easier to get started. Get on board now!

Note: I’ve interchanged PowerQuery and the M language in this post. Technically, they are different — PowerQuery is the tool, M is the language. But I think the thought is better communicated with this approach.

This post is originally published on Linkedin.

What to know more PowerQuery and Pandas goodies? Checkout on my book PowerQuery Guide to Pandas on Gumroad.

Follow me on Linkedin and Twitter.

--

--