Is it possible to pick up the source file for PowerBI dynamically.
Lets say I have a folder called as Productivity and inside that for every 2 hours a new file is saved out.
I would want the most recent file based on the file name.
Productivity-
Prod dec 21 - 1
Prod dec 21 - 2
prod dec 21 - 3
I want PowerBI to select the most recent one which is prod dec 21 - 3 and is it possible to show the file name on the report, so that they know how updated the data is?
You should be able to load a folder in the query editor. It will load a list of data files within that folder.
Sort rows by Date modified (descending), then choose Keep Rows > Keep Top Rows and set the number of rows to keep as 1.
Finally, click on the double down arrow on the Content column to drill down and return whichever table you are wanting to load.
Related
A new year is coming and the path where we save our data is changing.
The problem is: the data from each asset is saved in folders with the current year as it's name, so data from 2022 is saved in a folder called 2022, and so on.
I want to make a query that will autamatically indentify what years (folders) we have data from and combine them.
The data is saved in this path:
C:\Users\Projects\3. Assets\Type A\Asset Name\Control\YEAR\Data\Dataset\excel.xlsx
This asset for instance has 3 years of data 2020, 2021 and 2022.
By next week we will already have a 2023 folder with new data, usually a manually add a table.combine to the query, but we have a large number of assets and it can be tricky.
Someone knows a efficient way to automatically identify all the folders named with a year and combine the excel data inside them ?
This is the way i usually do:
Table.Combine ({Sharepoint("...2020/Data/Dataset"),Sharepoint("...2021/Data/Dataset"),Sharepoint("...2022/Data/Dataset")})
Sharepoint is a function that returns folder content from sharepoint.
Best Regards
Can you pull all the directory names at a higher level
similar to
https://exceltown.com/en/tutorials/power-bi/powerbi-com-and-power-bi-desktop/power-bi-data-sources/connect-power-query-whole-sharepoint-folder/
then filter them ?
I have the following output from two tables.
Item# Desc Sales Rank1 Company Sales Rank2 Rank Diff
1 Wigit1 500 1 ABC 15 32 31
2 Wigit2 300 2 XYZ 80 16 14
Rank1 data is from table A and Rank2 data is from table B. Both tables are tied together with the Item#. I'm trying to correctly get the Rank Diff to calculate from Rank2 - Rank1.
Do this in Power Query with a simple merge and add a Custom Column with the arithmetic. This can all be achieved using the menu and options, no code required. This is the same as in Excel, so here's a walkthrough from Microsoft that goes through all the steps you might need. Once you start using Power Query you won't look back. Good Luck!
if you don't have excess to 'Transform Data'( Power Query new name), then simply go to modelling tab and create a new column
Rank_Diff= TableName[Rank2]-TableName[Rank1]
i have a table, Partner Group is common from one excel file
then i have 4 more files with dates: dec '18, dec '19, jan '20. feb '20
the four excel files in powerbi are connected via the partner group file.
i have no idea how to get it to highlight the row based on high to low. i have tried many ways but it wont work
I have files in a folder which have same structure. The only difference between them is that for each day a new file is created which is named as date of the day.
So if file is created on 11th November 2019, its name would be 11092019.xlsx.
I have created a slicer which fetches names of all files present in this folder.
Keeping in mind that file format is same and only difference is in their file name and data values in them. Is there any way so that when I select a value from slicer the respective files data will be displayed in table visual ?
It is not possible to load a file interactively based on the slicer value.
You can achieve this by,
Load all files in the folder.
Combine them into a single table, where you need to add a "File Name" column.
Use slicer to show records coming from the specific file.
I am trying to create a parameterized dataset that imports files from GCS and puts them under each other. This all works fine (Import Data > Parameterize).
To give a bit of context, I store each day a .csv file with a different name referring to that date.
Now it happens that my provider added a new column since last month into the files. This means that files before this date have 8 columns, whereas from this date 9 columns.
However, when I parameterize, Dataprep only takes into account the columns that are matching (thus 8 columns only). Ideally I would want empty observations for the rows coming from files that did not have this new column.
How can this be achieved?
The parameterized datasets only work on a fixed schema as mentioned in the documentation:
Avoid creating datasets with parameters where individual files or tables have differing schemas.
This fixed schema is generated using one of the file found during the creation of the dataset with parameters.
If the schema has changed, then you can "refresh" it by editing the dataset with parameters and clicking save. If all the matching files contain 9 columns, you should now see 9 columns in the transformer.