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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pasheim
Frequent Visitor

Power Query - Making a selection menu at startup

Hi,
I am using Power Query to make a summarized ovierview of status on components in a datacenter. Every month, sours files are automatically generated an put in its designated folder. I am then using "Get Data from Folder" and specify which filenames I want the data from. However, as it is now, I have to make a new month folder for the source date every month.
What I would like to happen, is that when I start the Excel workbook Template, I get a question box asking med for which month/year I want to report data from. This question box generate a variable I then can use to filter out all data from source files with "Modidified date" withing specified month/year.

Ex:

Filname                                         Date Modified

15-01-2020 Source datacenter 1.csv       12.01.2020

15-02-2020 Source datacenter 1.csv       12.02.2020

15-03-2020 Source datacenter 1.csv       12.03.2020

15-01-2020 Source datacenter 2.csv       12.01.2020

15-02-2020 Source datacenter 2.csv       12.02.2020

15-03-2020 Source datacenter 2.csv       12.03.2020

 

I get data from the folder and specify that I only want data from files containing name "Source datacenter 1". However, this will collect data from all the months (01-03). I would like to be able to answer "Which month and year would you lik a report on" when I start the document, and then the queries use this variable to select all data ONLY from those specified dates (files with this  "Modidified date").
I am fairly new to using Power Query - so does anyone have a suggestion for me on how to approach this? That would help me a lot.
Pål

2 ACCEPTED SOLUTIONS
v-juanli-msft
Community Support
Community Support

Hi @Pasheim 

You could create query parameters in power query.

https://docs.microsoft.com/en-us/power-query/power-query-query-parameters

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Ah - thank you, Maggie. I believe this does the trick. After your tip, I also found this:
https://www.youtube.com/watch?v=gK2yBpiITvI

 

Best regards

Pål

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Pasheim 

You could create query parameters in power query.

https://docs.microsoft.com/en-us/power-query/power-query-query-parameters

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ah - thank you, Maggie. I believe this does the trick. After your tip, I also found this:
https://www.youtube.com/watch?v=gK2yBpiITvI

 

Best regards

Pål

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors