Customizing source table

Before you decide to create a pivot table, ask yourself: do you really need it? This report groups and aggregates data (summation, averaging, counting, etc.) and you may have already done so in the source table; maybe it is, in itself, a report? If you do decide to take this step, you will need to adjust it so that the pivot table can process the data, because it requires that the records be in rows.

Power Query parameters

Parameters are variables or sets of values ​​that are intended to influence the appearance of a query. They are mostly used for filtering, but if you know the “M” language you can also use them for other purposes. Since I will not (for now) write about how “M” statements are created, I will use a simple example where a single parameter will be created and we will use it to filter a query.

Conditional Column

Power Query has a feature called Conditional Column, and its mission is to emulate the Excel IF function. That is, by checking the conditions for the given column and the value returns the result if the condition is fulfilled and optionally the result if not. If no other parameter is specified it returns a NULL value in rows that do not meet the specified condition. Let’s see how this option is used!

Group By option

Power Query has features that allow you to group and aggregate data in a similar way as when writing T-SQL structures, without writing a single line of code. Therefore, the process is much faster and easier. Grouping can be done by one or more report dimensions, and the order is determined in a similar manner as when sorting. Also, multiple data aggregation functions are supported as well as possibility of multiple aggregation…

Combining files

Power Query gives us the ability to combine multiple files which belong to one folder. These can be TXT or CSV files, but in practice we will usually combine several Excel files. This is a very powerful option that can save us a lot of time. At the same time, it brings with it some challenges, which you will be able to learn more about in the following text …