cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luke_avalle Helper II
Helper II

Run Query Automatically and Save Output as CSV

Hi All,

can you guys please point me in the right direction (or straight up help me if you fancy it) Smiley Happy

 

I have my query configured to pick up a file form a shared folder location, process the file and output to an excel table.

 

I called the file "USER_PROCESSOR.xlsx".

Once powerquery did its magic, I then have to save the file as "USERS.CSV" on another folder.

 

I want to avoid manually opening the XLSX file every 6 hour to run the query and save as .CSV, how can this automated?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Run Query Automatically and Save Output as CSV

Hi @luke_avalle ,

 

Yes, to the first part.  However you can select refresh in the desktop.

 

Explanation for exporting data.

 

Also you might look into dax studio, a free product.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Super User IV
Super User IV

Re: Run Query Automatically and Save Output as CSV

Hi @luke_avalle ,

Because the data sources are external, you can manually refresh the dataset by using Refresh now or you can set up a refresh schedule by using Schedule Refresh. When you refresh the dataset, Power BI does not connect to the file on the local drive to query for updated data

 

Here you go.

Refresh

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




luke_avalle Helper II
Helper II

Re: Run Query Automatically and Save Output as CSV

thank you for the always prompt reply!

DO I need POwerBI server for this?

Also, can I program it to save the output as CSV (2nd part of my question?)

Luca

Super User IV
Super User IV

Re: Run Query Automatically and Save Output as CSV

Hi @luke_avalle ,

 

Yes, to the first part.  However you can select refresh in the desktop.

 

Explanation for exporting data.

 

Also you might look into dax studio, a free product.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

luke_avalle Helper II
Helper II

Re: Run Query Automatically and Save Output as CSV

I ended up using powershell and task scheduler on the server.

The code is minimal and works very well

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors