![1703736026_e774d10cbbb9450fc45efbe51abdf434.jpg](https://quantinsightsnetwork.com/wp-content/uploads/2023/12/1703736026_e774d10cbbb9450fc45efbe51abdf434-678x381.jpg)
Welcome back to this week’s edition of the Power BI blog series. This week, we look at an issue when importing data from Excel.
Consider the following Excel data:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image1.png/e774d10cbbb9450fc45efbe51abdf434.jpg)
In Power BI, I can ‘Import data from Excel’.
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image2.png/f32e5a15e2cf9c3e4d2d058458ce054d.jpg)
This takes me to a browser window where I can select my file, and I choose the Excel Workbook and see the data on the Navigator dialog:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image3.png/f1140ff857fc3b6f5f97a6a24f4a6fc7.jpg)
In Power BI Blog: Fully Imported, I described how I could load the whole Excel data model by accessing the File tab. To show why this should only be used when there is a data model to be preserved, I will repeat the process for this simpler Excel workbook:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image4.png/72aa864d2854c6fefb1083fba0ab5792.jpg)
On the Import tab, there is an option to Import from ‘Power Query, Power Pivot, Power View’. I choose this option, and if I haven’t already saved my current Power BI file, I may get a warning:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image5.png/36776d1da4d05b45bb5a5d09375f407c.jpg)
Having saved my Power BI file, I browse and choose my Excel Workbook:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image6.png/23912d3b1671861e02bebcd5183f1607.jpg)
I choose Start, and Power BI updates me as it progresses:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image7.png/6f49c288a0d88a66b427eaf4ece923d6.jpg)
This time however, I don’t get the results I was looking for:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image8.png/b9ee28d90e6b5bc92ea4aeafdad51628.jpg)
Notice the name of the option on the Import tab:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image9.png/0485ccbc83bdeec1d741bad442a1ea5f.jpg)
I have no queries, so the data cannot be uploaded this way. Clearly the best way to import this data, is to use the ‘Import from Excel’ option I started with, which can also be accessed from the ‘Get Data’ dropdown. The Import ‘Power Query, Power Pivot, Power View’ option is not designed to cope with this. Let’s see what happens if I persist with this method…
If I extract all my data to queries in the Excel Workbook using ‘From Table/Range’ on the ‘Get & Transform’ section of the Data tab:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image10.png/daf8c4f0259ce428269c0d3d4badd32b.jpg)
I can then ‘Close and Load To’ from the Power Query Editor:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image11.png/22c6daeb82d7d69ac88f878227e04b28.jpg)
I don’t need two copies of the data, so I only create a connection:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image12.png/a1537847463e660a31158c8032525438.jpg)
Having done this for all the data I want to import, I can save and close the Excel Workbook and try again, and this time I get an extra step:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image13.png/917da985be13220165c8d2823e95344f.jpg)
I can opt to ‘Keep connection’:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image14.png/8c3be7af9f73d031acae69ed85a2e148.jpg)
I am then prompted to ‘Apply changes’:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image15.png/e63c0a4c21afc9afb438aacc09a59317.jpg)
The Fields pane doesn’t look promising!
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image16.png/d082e3477129350b8a2a589156028e63.jpg)
If I choose to ‘Transform data’ from the Home tab, the data is in the Power Query editor:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image17.png/a468c9c28195e8f18fdedfa59a0cf042.jpg)
Everything is in italics in the Queries pane, so I can ‘Enable Load’ for Table5 by right-clicking:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image18.png/61935f470d8b9f21b7b7683ffca40895.jpg)
It then appears in the Fields pane:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image19.png/06909e3fbfc8faf87de7555c0b99e9d3.jpg)
Now, what if I had used ‘Copy data’ instead:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image20.png/173ef895b62ce391674d271b99c4d178.jpg)
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image21.png/bc31e9359fd69b42bc104de457d8f9f8.jpg)
The tables with the information option have not been copied as they are too large, the connection has been kept instead. The results are actually worse this way; not only is everything still set not to load, but some of the data hasn’t been copied in the correct format:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/218/image22.png/059b7a0f2b398df09f943b811a5b3126.jpg)
Only use the Import ‘Power Query, Power Pivot, Power View’ option to import data from Excel when there is a data model and relationships to preserve. Power Query really is the best tool for importing Excel data to Power BI in all other circumstances!
Check back next week for more Power BI tips and tricks!
Be the first to comment