Power BI getting new data from a file: how could this be done better? - excel

I have a Power BI in my local folder.
I have inputs, excel files.
When I have a new input with new data, in the form of a new excel file, I only care about these new data. I do not care about anything data in the past file.
Currently, when I receive a new excel input:
I change the name of the excel file giving it the same name as the file that it will replace.
I suppress the old excel file in the folder where it is stored
I replace it with the new excel file, with the name of the old one in the folder of the old excel file
To provide a concrete example, here is my folder with two files and my power bi:
If I have a new file with corresponding to the "Rabbit employed by Batman", I supress this excel file in the folder.
I change the name of my new excel input, calling it "Rabbit employed by Batman".
I replace it in the folder with the Power BI.
I feel that this might not be very clever, and I wonder if there is a better way to proceed.

In Power Query use excel from folder, sort by date and choose the latest one, If you have more than one file with the same name, create an Index, rank over filename sort descending and use the number 1 as your binary source.

Related

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

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

How to use file path in excel name manager

I created an excel document with references to other files. The table is pretty big and i would like to simplify the formulas of the cells. Hence I want to declare the file path in the names manager so that i can replace
='C:\Users\...\[worksheetname]tablename'!cells
with
=Name!cells
Is there any chance to get this working? It would be good, if the source file (the file, which the path belongs to) does not have to be opened in order to get the data.

Dynamically retrieve data from Excel into Word using parameters that are in the word file

On one hand there is an excel file with a table. In the table there are village names and a bunch of attributes in the columns.
On the other hand there is one docx file for each village. Within this file there are tables that need to be dynamically updated based on what is written in the xlsx file. If I was within excel I could use simple INDEX MATCH formulas that use name of village and name of paragraph to retrieve the right information from the xlsx file. But I am in a docx file...
To go through naming each cell in xlsx and linking it would be too tedious (there are hundreds of fields). Is there any way I could escape VBA? Thank you for any ideas (including VBA if really necessary).
You could use a DATABASE field in the Word document to retrieve the data for each village from the Excel file - one DATABASE field per village. See:
https://support.microsoft.com/en-us/office/field-codes-database-field-04398159-a2c9-463f-bb59-558a87badcbc
You will, of course, need to create the necessary query statement.
An example of such a DATABASE field's usage can be found at: https://www.msofficeforums.com/mail-merge/21847-mail-merge-into-different-coloumns.html#post67097

Excel: Getting data from a daily replaced excel file

I have an location in one drive for business where an .xls file is getting daily replaced via flow automation. The data structure, columns is the same. What I want is to create an excel online workbook that would get its data from that daily replaced xls. I tried once but as soon as the source file got replaced and I clicked on Refresh all under data, the operation ended in error. Any ideas?
You can use Power Query in that scenario. Depending on the exact circumstances, you could
Get data from Folder
Filter the folder to show only files that contain '.xls' in the file name
If after that you still have more than one file, sort them by date modified and keep only the newest one.
Then process that one remaining file.

Excel - How to connect to another Excel file?

I have a big spreadsheet(Excel file A) which will be updated every month. Also, I created a parametric search in another Excel file(file B) which can pull data from Excel file A. Therefore, Once I send my parametric search Excel file B to my colleagues, they can always pull the fresh data without updating file B (I would need to update file A monthly to keep data fresh)
I tried to connect data by using Microsoft Query/web data. However, I noticed that if I use web data, the source link changes everytime I update the File A. Therefore, the file B connection won't work.
(I uploaded the file A to JIRA as an attachment. I tried to upload to Sharepoint, but Excel does not recognize Excel file on Sharepoint as an Excel file, it recognize as a html file. Therefore, I gave up using sharepoint)
Is there a better way to achieve what I have described above?
Thanks,
Jennifer.
Since you are using SharePoint, choose From File > From SharePoint folder and input the root URL (e.g. https://companyname.sharepoint.com/sites/workspacename/).
This should give you a dialog box like this once you've logged in:
Click on Edit to open the query editor.
You likely only want one particular file in there, so click on Binary in the row that corresponds to the File A that you should have already uploaded to that space. This will import the Excel file.
Click to expand the Table in the row that corresponds to the table that you want to import. This should be the table you keep up to date that gets loaded in.

Resources