Power Query to open XML file formatted as Excel would open it - excel

I have an XML file generated by EasyPower (electrical software). If I open the file in Excel it comes up as a series of formatted sheets like the image below. It appears this way without any prompts or dialogs.
I’m creating a Power Query routine that can extract the data from the sheets. Unfortunately when I use the Power Query wizard to select the XML file as a source, it doesn’t see the data as sheets, but rather a table with columns of Tables, seemingly an infinite number of levels deep. Digging through them I’m unable to clearly see the data. This is not a very good approach.
A work-around is for me to manually open the XML file with Excel and save it as XLSX, then it’s easy to work with the data in Power Query. I know a VBA script could be used to this but my question is, is there a way for Power Query to open an XML file and interpret the layout the same way that Excel does? This way would allow my script to also work within Power BI.
Edit: A sample file has been requested. This link will provide a very simple example containing two worksheets when opened in Excel. EasyPower_Test_Schedule.xml

Related

Excel file linked to Access; Access linked to Power Query; Excel file pop up when refreshin PowerQuery

I have the following situation:
1- I have one Excel File linked to my Access database called "Input"
I use this file to create a query that allows to extract only the information from the references in the "Input" file.
2- After creating the query (merge) I get this extraction with the Power Query function from my "Main" table i use to work.
I do this because in the Access i have tables with +1M rows and PowerQuery cannot handle them.
When i refresh my linked PowerQuery tables that comes from "Input+merged info" the "Input" Excel would open.
This happens with every single Excel file i link to the Access and get them with PowerQuery later on.
It seems that to "refresh" the information it is going all the way down to the source of the information and opening it to update it.
There is an option to solve this and it is importing the Excel Files - but that generates an extra work that would complicate everything as Access size would be +2GB.
Does anyone know how to solve this issue?
Thank you!!

Excel Protected Data Source For Power Query

I am exporting reports from QuickBooks Online as Excel attachments via email. I am then using Microsoft Flow to save the attachments to Sharepoint. Then, I am using those Excel files stored in Sharepoint as the data source for my reporting. I have one report (out of 7) that's coming through with a protected view, which is causing it to look like this in Power Query:
The actual Excel file looks like this when I open it:
From what I can deduce, this is because there's some level of protection on the Excel file. However, the other theory I have is because each of the cells have "=" before the numeric value. In other words, the first cell has "=750" instead of just "750". If I go into Sharepoint, open the file in Excel Online, remove the "=" in just that one cell, and refresh Power Query, then the amounts show up in the editor as expected.
Is there any way to deal with this in Power Query? Thanks in advance for your help.

Excel PowerPivot - change data source type

I have an Excel 2016 with 30 graphs based on PowerPivot. PowerPivot fetches the data from another Excel sheet, but I want it to get the data from a SQL server table instead.
How can I change the data source type in PowerPivot? I've tried looking in the Excel xml without any luck. Would be a lot of work re-creating all graphs over again just to switch data source
Thanks
Dennis
One suggestion I would make for the future, if all the users are using 2016 is to use Power Query which comes standard with that version of excel. In the Power Query loading data into Power Pivot scenario, all Power Pivot cares about is the column names. This means that the query can be changed between data source types without causing issues, as long as the same column names are changed.
As an example, I have one file that based on a parameter flag rips data out of a series of excel files on a shared network drive or Share Point. Both of which would be different data sources. The first opening a folder as the data source, then excel files listed within the folder. The other opening a share point list as its data source, then navigating though excel files.

Using a JIRA saved filter with REST API and Excel

I have a report that I need to update in Excel many times a day using statistics from JIRA. If I can import these directly with code I would save a lot of time and effort.
Is it possible to use a saved JIRA filter in conjunction with the REST API function to import the results to Excel using a VBA macro?
This is a solution does not use REST API, but it may work for you. This is a workaround I am using so far and it works:
Run the Filter in Jira
Export the result list into an excel file using the Export CSV file with the option current field (to avoid having unnecessary fields) and with the right button of mouse select: Open in a new window
Now you will see the URL associated with your filter in a new window of your browser. Your filter is represented by a Filter ID, therefore the query will be always the same.
Go to excel and use the URL as a hyperlink
Every time you click on the hyperlink it will download the file from Jira. You need to have a Jira open sesion in your browser.
Create a VBA marco that click on the hyperlink for downloading the file.
Use Power Query for example for loading the file from the download folder location into a worksheet. Power Query is a new excel feature. Power Query is an ETL tool integrated into excel for loading files and processing them.
The steps 6-7 automates the process. Run the Marco for downloading the file and refresh the content of your worksheet from Data Connection. You can have an additional macro that refreshes the content of the worksheet. It refreshes all pivot tables and the file connection for reading the file.
Hint: Use excel Table for keeping the information updated automatically when additional information is loaded into the worksheet. If you use pivot tables for presenting the data, use as data source an excel table instead of excel range.
It minimizes a lot the manual effort.
Here you can find a solution that uses REST API, the author provides the source code, but it is more complicated. If you need something simple, my solution may work for you.

How to export Reports in Microsoft Access in a specific manner

I have a client that reads their reports in Microsoft access...the woe is she tries to export the report to an excel file by right clicking on the report and going to export->Excel
This works, but the labels are not in the right order etc... in the report they are right..but in the exported file they need more data (or she wants more). I have to say I am perplexed how to somehow intercept the export and write my own xls file out based on the query that generated the report... or some other way? Maybe another report that is generated that is for the sole purpose of exporting that has the columns in the final xls file the way she wants...I am not a guru at this just know enough to be dangerous so I am not sure what the best method to attack this is and get it where the exported report as an excel file has the columns she wants.
You have two options one is more efficient and one more flexible:
More efficient:
Write the query to a CSV file file using IO statements
More flexible:
Build the Excel file cell by cell using an Excel object. Of course you can use loops and make it generic so it will work with any query passed as a parameter

Resources