Clicks or code? Power Query offers a rich set of features, that allow to transform the data without writing a single line of code. Even if you want to focus primarily on coding skills, it is still good to know what UI has to offer.
When talking about Power Query for Power BI, we have two experiences available:
Desktop – Allows to transform and load or connect to the data required to build reports.
Dataflows – Allows to build reusable data entities and share them across multiple semantic models.
There is already some complexity I must highlight here. I could say that there are two places where Power Query experience is available. Instead, I mentioned that there are two experiences available. It’s because both solutions are not exactly the same. Dataflows were introduced later, and they are equipped with a bunch of nice features, that Power Query in Desktop experience is lacking. There is a commitment from the product team the same, however, for now we must know the difference.
Not to mention that within Microsoft Fabric (so no longer Power BI related only) there is another Power Experience – Dataflows Gen 2, which are again slightly different. I will cover this topic in separate articles.
It is impossible to cover all the features of Power Query in single article. That’s why I will cover only high-level overview, to help you navigate inside of this great tool. Without further ado, let’s start with today’s topic – desktop experience.
How to open Power Query editor
There are many options you can use to open Power Query Editor. If you had a chance to read my introduction to Power Query, you know, that this is the first experience in Power BI, as it is used to connect to the data. Therefore, the firstand most obvious way would be to get data using one of the options available in Data section of Home ribbon. While Load option will simply load the data to your model as it is, Transform Data opens Power Query Editor, so you can do data preparation before loading it to the model:
Figure 1. Get data experience.
Second option would be to use Transform Data (previously known as Query Editor), right next Get Data options:
Figure 2. Transform Data.
If you already have some data loaded to the model, you can use third option – go to Data Pane to the right -> right-click on the table you would like to edit and hit Edit Query:
Figure 3. Edit existing query.
Data Pane is available in other Power BI Views as well (Data and Model View), so you can to the same there. In Model View you could also right-click on the table that you found in Data Model. Let’s call it the 4th option. It’s good to have all these options at hand, as they may proof being useful in different situations. But of course, it is important to know only one 🙂
Building blocks of Power Query
You did the first step, and you are in Power Query, what next? Let’s have a look what hides inside:
Figure 4. Building blocks of Power Query.
Data Preview – at the very center you can see the preview of your data. By default, you will see a thousand rows here.
Ribbon – here you can find all the features and settings available through UI. I will cover them a bit later.
Queries page – Naming here is a bit tricky, but correct. Very often people tend to say that this is list of tables loaded to the model. Whatever we do here, there is a Query generated in the backend using M language. So, the queries list covers all data structures (tables, lists, records, scalar values), parameters, functions. In short, whatever we need to prepare the tables to load them to the model.
Querry Settings – Details of currently selected query in Queries pane. Here we have easy access to query properties, and (most importantly) list of all the transformation steps applied in selected query.
Status Bar – a bit hidden but important section. It shows some statistics like number of columns and rows (rows limited to sample size – 1000 rows). Most importantly, you will find here the processing status and warnings if something is wrong with your query. Unfortunately, no warning is displayed if problem appears outside of sample loaded as data preview.
Data Preview
This is basically a graphical representation of your Query. Whatever transformation you use, Power Query recalculates the results and present them as Preview of the final result. For many Power Query beginners, that concept of the Data Preview is hard to understand. Many of them try to select a row and remove it, or they ask how the row order can be changed or modify a value in specific cell. So, the only way to remove rows here is to apply filters or use Keep/Remove Rows function. The last one must be used wisely, as you can’t assume that your data preview will look always the same, unless you can force that behavior using other functions. However, the thing that is more or less intuitive for excel users is a Column of Data. This is actually an object that you can select, move around and remove.
Each column has a header and data type associated with it. You can also display additional information for each column, by enabling specific settings in View tab in ribbon. You can either right click on specific column to quickly discover useful column level transformation, or click on a small icon in top-left corner of the table, to discover table level transformations:
Figure 5. Quick access to table level transformations.
Therefore, if we talk about only what is available through User Interface, to apply any change to your data on a row level, you must apply a column level or table level transformation.
It is important to mention here, that technically speaking, tables that we see in Power Query are not made of Rows and Columns but Records. If you select a specific row of data, what you see at the bottom of Data Preview is a Record:
Figure 6. Display a record in Power Query
You can say that a Record is a list of fields, where each field is a name/value pair. The field names are nothing else but Column headers, and field values are simply values from column for selected row. I mentioned before, that staying in the world of UI there are no row level transformations. There are record level transformations, but they are available through coding only.
Coming back to Columns topic, column headers have couple of “hidden” features. As mentioned above, you can right-click on column header to quickly find some of the column level transformations, but that’s not all you can do with column headers:Figure 7. Column header in Power Query.
You can click on the symbol to the left of the column name to change the data type of that column.
You can double-click on the name column name to rename it
You can click on arrow to the right, to perform sorting or filtering operations
I also mentioned that you can use Data Preview to quickly get useful insights on the column content:
Figure 8. Column level information
Column Quality – Valid row is a row with data and without errors. Error indicates issues with at least one applied transformation. Empty rows hold no data. It is important to mention, that no data for Power Query is represented by null value. Blank is an empty string, which for Power Query is a value.
Column Distribution – Quick graphical overview of the uniqueness of the data. Not sure if there is a lot of added value in column chart, but the summary with number of distinct and number of unique values is already pretty useful.
Column Profile – Wider column statistics, including information available in Column Distribution feature. Here, value distribution chart is useful, as we at least see the category related to the bar length. On top of that, you can select on specific bar, and quickly apply filter operations:
Figure 9. Filter a column by selecting vale in Column Profile.
Last important part of Data Preview is the Formula Bar, that you can see in all the screenshots above column headers. This shows the code behind a single transformation step for the selected Query. It’s a last step in query or the one that you specifically selected in Applied Steps available in Query Settings. Code doesn’t have to written by you; Power Query generates a code like this any time you apply any data operation using UI. It helps a lot to start looking into coding area of Power Query.
To be continued
I barely scratched the surface, as I still must cover other 4 components of Power Query. In next articles I will talk about the Ribbon, Queries, Querry Settings and Status Bar. Stay tuned.
For now, thank you for reading, and see you in next article 🙂
Pawel Wrona
Lead author and founder of the blog | Works as a Power BI Architect in global company | Passionate about Power BI and Microsoft Tech
Power BI Settings are very often overlooked by beginners. Many of them have very significant implications. Let’s uncover the secrets of Auto Date-Time feature,
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.AgreeDon't agreePrivacy policy
You can revoke your consent any time using the Revoke consent button.Revoke consent