Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
452 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Software ==> | Power BI (160 exercises) |
Topic ==> | Query editor (9 exercises) |
Level ==> | Harder than average |
Subject ==> | Power BI training |
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
This exercise covers unpivoting data, changing data sources and more besides! To begin with, create a new report and load the data in the First Half.xlsx workbook.
User Query Editor to tidy up this data so that you have something like this:
You'll need to remove the top row, then make the new top row into the row headers.
Choose the following option to unpivot the monthly data:
Choose to unpivot the months of data.
After a bit of renaming, you should have this table in Power BI:
The start of the table of unpivoted data.
Use this to create a chart showing value by month:
The problem is that we want to sort the months correctly, but to do that you'll need to assign numbers to them.
Go back to Query Editor and add a conditional column:
The option to add a conditional column, returning the correct month number for each row.
This should give you something like this:
After painstakingly typing in the 6 possible conditions and results, you should have a column turning a month name into a number.
You might have found it easier to do a couple of conditions then edit the M formula for this step to add the other four (it's certainly worth having a look at it to see how easy it is to understand and amend).
You can now choose to sort your month names by number:
Choose this option to sort your month names correctly.
After checking your chart is sorting by the correct column, you should now have this!
The same chart, but with the correct sort order.
Oh dear - Wise Owl can only apologise. The exercise asked you to link to the wrong file. Change your M to refer to the file called Second half.xlsx (you'll need to go down your query steps making lots of editing changes to resolve errors), then check your chart still works:
After a lot of retyping in your query step formulae you should eventually get this chart!
Save your report as The knees of a bee, then close it down.
You can find other training resources for the subject of this exercise here:
From: | Orin |
When: | 24 Jul 25 at 10:08 |
Out of topic but not so much : this exercise, with its final twist, is really good at showing how terrible is Power BI, still in 2025, for someone used to speed with Excel.
After years using an (many times improved) interface to help us write formulas, suddenly you have to learn this M language with Google / GPT constantly open because there is no built-in help, no formula category, barely an autocomplete.
Want to read your formula comfortably ? Only 5 lines, then you scroll.
The complexity of the formula to go from "January ; February ; ..." to "1;2;..) reminds us that if AI can threaten so many jobs it is also because so many tools are built ignoring the idea of being productive.
From: | Shaun |
When: | 28 Jul 25 at 08:06 |
Hi Orin,
Considering that the Query Editor was in Excel many years before Power BI was introduced, I do agree that they should have made it more user friendly. Add to the things you mention the fact that M is case sensitive unlike most functions, it is a difficult language to learn but worth the effort if you need to clean lots of data.
The link below will at least offer some help on the functions.
Power Query M function reference - PowerQuery M | Microsoft Learn
Thanks
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2025. All Rights Reserved.