Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Folder as parameter

Hi,

 

I have a requirement where i want to read data from a folder location.

This folder has 10 excel files and i want to show these 10 as a filter parameter for a user to choose and my visuals should be filtered based on the data from that excel sheet.

I am able to pick up latest file by default (Keep Top rows 1) but is there a way to give user to filter which file they want to analyse from that folder.

FYI: all files are of same extension, just weekly some data is added/removed from the file.

 

Thanks in advance.

 

Namish

7 REPLIES 7
nsr299
Regular Visitor

Newbie here...

 

Is it possible to create a parameter that can swith between a folder and Sharepoint folder as a source?

 

Thanks!

Greg_Deckler
Super User
Super User

@Anonymous - So, are you using a Folder query or are you grabbing them all individually? When you use a Folder query, there is a step where the name of the file is included. I think it gets selected out but you could modify the queries to keep it. Not sure if this is what you are going for or something else. It's not super clear.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks @Greg_Deckler., sorry if i am not clear

I am trying to read data from a folder as Data source. Assume folder contains 10 files If i read the latest modified file (Top 1 row) this works perfect.

My question was if i need to show the user a list of file names in this folder (10 names), so they can choose which file they want to analyse?

NamishB_0-1599434298370.png

 

I hope this will be clear? Is there any clean way to do the user input on folder?

 

Cheers

@ImkeF @edhans , how do you preserve the Source.Name field in a Folder query so that it shows up as a column in the final table? Thanks.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Anonymous - to preserve any columns after you've done a combine operation, go back to the automatically generated Remove Other Columns1 step, hit the gear icon, and check what you want to keep. I think the August 2020 version of Power BI Desktop does this automatically for you (I just tested) but I know this has not always been the case, and it may depend on the types of files (text, Excel) and where you are combining from (OneDrive, local folder, SharePoint Library, DataLake, etc.)

 

You can see that Folder Path is  there for selection as well if you want it.

 

edhans_0-1599499811310.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans - Thanks, for some reason I could not track that down!! @Anonymous does this get you where you need to be?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Anonymous , Not sure I got it . but you have Folder.Files, that will return you table of files

 

https://docs.microsoft.com/en-us/powerquery-m/folder-files

 

also refer : https://radacad.com/power-bi-get-data-from-multiple-files-in-a-folder-on-onedrive-for-business-no-gateway-needed

https://medium.com/@wkrzywiec/getting-data-from-the-latest-file-in-a-folder-using-power-query-51dfa4bff711

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.