Power BI videos | Power BI Part 3.1 - Getting Data from Excel

Posted by Andrew Gould on 17 June 2019

This video shows you how to import data from Excel into a Power BI report. You'll learn about the importance of Excel tables and range names and how to select the appropriate range to import. You'll see how to import multiple tables and create one-to-many relationships between them. You'll also learn about using the Power Query Editor to clean up untidy data by deleting rows, promoting headers and altering data types. The final part of the video explains a couple of techniques for appending multiple tables into a single list, and how to merge multiple queries into a single table to make it easier to create reports.

You can download any files that you need to follow the video here.

You can increase the size of the video:

Full screen mode for YouTube

You can view the video in full screen mode as shown on the left, using the icon at the bottom right of the frame.

You can also increase the quality of the video:

Changing resolution

You can improve the resolution of the video using another icon at the bottom right of the frame. This will slow down the connection speed, but increase the display and sound quality. This icon only becomes visible when you start playing the video.

Finally, if nothing happens when you play the video, check that you're not using IE in compatibility view.

This page has 1 thread Add post
27 Nov 19 at 11:20


Having watched this video, in particular the part about merging tables, it leads me to think that it is actually doing a vlookup.  Many people have expressed their desire to use Power Query to do vlookups because of its speed.  My question is: how do you incorporate the vlookup performed using Power Query into VBA?

Suppose in Excel on Sheet1 column 1, I have the values 1,2,3,4,5 and in column 2 the values a,b,c,d,e.

Also on Sheet2 I have the value 1 in cell A1. Running the following simple code would return the value of "a" into cell B1 on Sheet2, as expected:

Option Explicit

Dim SourceArray() As Variant

Sub Start()
    SourceArray() = Sheet1.Cells(1, 1).CurrentRegion.Value
    Call Module1.Lookup
    Erase SourceArray()
End Sub

Sub Lookup()

    Sheet2.Cells(1, 2).Value = Application.WorksheetFunction.VLookup(Sheet2.Cells(1, 1).Value, SourceArray(), 2, False)
End Sub

My question is: if the Lookup subroutine was done manually using Power Query, how can that code be generated? As far as I'm aware, (and do correct me if I'm mistaken), clicking the macro recorder button then performing Power Query steps manually DOES NOT generate any VBA.


27 Nov 19 at 14:01

I don't think Power BI supports VBA in any shape or form (others agree).  I would suspect that Microsoft will never add this; they're more likely to let people automate Power BI using M, Python or C#.