Sometimes Power Queries generate errors. Some errors stop all data being returned and others will return a blank cell for the error in the returned table. You can list the rows that are generating the errors. This can help you identify what is causing the error.
Tag Archives: Power Query
Excel Power Query and Multiple Files 2023
In this recording of a live webinar I ran in late January 2023 you will learn how to import multiple files in a single Power Query. If you use data at all then Power Query is an essential skill to possess.
Use the buttons below the video to download the materials.
Building on the skills covered in the Introduction session, we will start working with multiple files. For example you may have 12 separate CSV files in a folder. All with the same layout, one for each month of the year. Power Query can import all 12 files as if they were a single file and create a table for the whole year
This session covers
• importing multiple CSV files from a folder
• a technique to capture the file name in a field (column)
• importing multiple Excel files
• merging data from multiple tables
• Extracting header information into a column from multiple CSV files
As always, I shared other tips and tricks along the way.
Introduction to Excel Power Query 2023
In this recording of a live session ran in late January 2023 you will learn how to automate data importation in Excel with Power Query. If you use data at all then Power Query is an essential skill to possess.
Use the buttons below the video to download the materials.
Power Query allows you to automatically perform data cleansing routines on your data sources – no manual intervention required. Simply refresh and your data is ready to use. You can use csv files; txt files; databases and existing Excel tables as your data sources.
Learn the basics, plus an advanced technique to automate data cleansing routines on your data sources.
This session covers
- fixing dates so that Excel can recognise them
- formatting columns as text – retaining leading zeroes in CSV files
- deleting unwanted rows and columns from your data
- removing leading and trailing spaces
- populating blank values with zeroes
- populating blanks with entries from above
- correcting trailing minus signs
- unpivot a report – converting a report layout into a table layout
- converting a MYOB report into a data table
- capture header information in a column
As always, I shared other tips and tricks along the way.
Excel Power Query Saving Issue
There was a recent discussion of this topic on LinkedIn. When you are in the Power Query window you can’t save the query. If you Close and Load and Excel crashes, you could lose your work. If you have spent some time working on a query this can be frustrating. Here’s how you can capture the query before using Close & Load.
Excel Power Query and Multiple Files 2022
Webinar recording from April 12, 2022
This is the recording of the second free Power Query webinar I ran in 2022.
You can watch the first one at this link.
In this session we see how to import multiple files in one Power Query. We look at importing CSV and Excel files.
You can download the materials, including a detailed pdf manual using the button below.
Handling Multiple Columns in Power Query
Choose Columns drop down
In general, you should reduce the number of columns you import via Power Query to the minimum you require. Here is a quick technique to make that a bit easier.
Excel Power Query and Data Types
Get the Type right
Data types are an important part of Power Query in Excel and Power BI. They define the type of data that should be in a column. When performing some calculations, getting the column data type right is vital.
Convert text time to real time in Excel
Three different ways
I recently downloaded an example file for an Excel challenge. The challenge had a lot of things to do but they were all based on a Timestamp column that had text instead of times.
Power Query Finding Text in Another Column
Return TRUE if text is in another column
If you need to find if text is in a column you can use the Text.PositionOf function to confirm it exists.
Financial Year in Power Query
184 is the magic number
If you need to extract the Australian Financial Year from a date in Power Query here is how to do it.
Segmenting a Table with Power Query
Slicing and dicing a table
In my previous post I mentioned you should, as far as possible, keep data together in a single table rather than splitting it up between sheets. If you want to split it up for distribution purposes here is an easy way to do it.
Don’t split your data in Excel
If you have Power Query you can consolidate the data
I have received a few questions recently relating to working with data spread across multiple sheets. In general, if the data is in the same layout, keep it in one table.
Stop Power Query from automatically setting Data Types
It is a setting
When you transform data using Power Query it will often automatically promote the headers (use first rows headers) and guess the data types for each column. You can stop it doing this.
Power Query and large data sets
Saving time
When working with some large data sets in Power Query it may be useful to default your Close and Load option to Connection Only rather than a Table. That way if you do strike an issue it won’t take ages to load to data.
IFERROR in Power QUERY
Keep trying
Power Query does not have an IFERROR function. It does however have another function that performs the same type of calculation.
Creating a list of files in Excel
Power Query solution
Let’s say that you need to create a list of files in a folder. This is possible using VBA, but it is also possible in Power Query and it’s much easier to do in Power Query.
Creating Groups for Power Queries in Excel
Put some order in your queries
Once you start to use Power Query you may find yourself with quite a few queries in the one file. To make it easier to control them you can use groups to keep similar queries together.
Free Webinar Recording – Introduction to Power Query
Feedback score 94.5% based on 91 responses
In October 2019 I ran my Introduction to Power Query webinar for free (previously it was a paid session). I want to get this information out to as many people as possible. please share this resource with colleagues and your network.
The detailed pdf manual and example file can be downloaded by using the button below. Content listed below the video.
Power Query allows you to automatically perform data cleansing routines on your data sources – no manual intervention required. Simply refresh and your data is ready to use. You can use csv files; txt files; databases and existing Excel tables as your data sources. Learn the basics, plus an advanced technique to automate data cleansing routines on your data sources.
CPD note – if you are claiming CPD for watching this recording you need to keep your own records. People who attend the live sessions receive an annual listing of attendances.
This session covers
- fixing dates so that Excel can recognise them
- formatting columns as text – retaining leading zeroes in CSV files
- deleting unwanted rows and columns from your data
- removing leading and trailing spaces
- populating blank values with zeroes
- populating blanks with entries from above
- correcting trailing minus signs
- unpivot a report – how to convert a report layout into a data table layout
- converting a MYOB report into a data table
Promoting Headers Issue in Power Query
Be careful if a first row name changes
Promoting headers in Power Query means using the first row as column headers. In Power Query this is a useful and common option. In some cases it is even automated. There is one time though when you don’t want to use it.
Power Query Fill Down Doesn’t Work
The fix is easy
Sometimes when working with CSV files in Power Query you may strike the situation where Fill Down doesn’t fill down. Don’t worry there is an easy fix.
Power Query and Open Excel Files
Old school solution
Power Query can easily combine data from multiple Excel files. A problem can arise if one or more of the files is open. Power Query will generate an error and the import will fail. The solution involves an old school Excel feature.
Creating a table of all combinations in Excel [Video]
Power Query solution
Let’s assume you have three state codes and four department codes and you want to create a table of all the possible 12 combinations (3 x 4). How do you do it so that it is flexible? i.e. if you add a new state or department it must be easy to update the combination table.
Creating a Unique Dynamic List in Excel
A Power Query technique
There are a couple of techniques to automate a unique list of items in Excel. I have covered them in previous blog posts (see links below). I thought I would describe how to use Power Query to create a dynamic unique list.
PowerPivot and Power Query
How to get and install
I have run two introductory webinars in 2016 on these two topics. You may need to download them and install them before the webinars so you can use them during the webinars. The Add-ins are free from Microsoft.