Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have a Power automate flow which exports the data in a visual using Run a query against a dataset.
I want to dynamically change the exported csv file name.
can someone explain how to achieve that?
Regards,
Karthick M
Hi @Karthick1006
Sorry for the inconvenience caused.For deeper help on Power Automate actions and expressions, you may also want to ask in the Microsoft Power Automate Community:
https://community.powerplatform.com/t5/Microsoft-Power-Automate/ct-p/MPACommunity”
This way, you cover both Power BI and Power Automate experts.
Thanks and Regards,
Cheri Srikanth
Hi @Karthick1006
Yes, it's possible to pass slicer selection dynamically to the “Run a query against a dataset” action. Follow these steps:
Create a DAX measure in Power BI using SELECTEDVALUE to capture the slicer selection.
For example: SelectedCountry = SELECTEDVALUE('Country'[CountryName], "Default")
Add the Power Automate visual to the report and include the SelectedCountry measure in the fields section.
In Power Automate, set up the flow to accept the slicer value as an input parameter, like countryParam.
In the "Run a query against a dataset" action, replace any hardcoded values with the dynamic parameter using this format: TREATAS({ "@{triggerBody()?['countryParam']}" }, 'Country'[Value])
Save and test the flow to ensure it correctly picks up and uses the slicer value in the query.
If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.
Hi @v-csrikanth
I have followed the steps as per your instruction but it is throwing the following error
Regards,
Karthick M
Hi @Karthick1006
Thank you for being part of the Microsoft Fabric Community.
By following these below steps, you can dynamically change the exported CSV file name based on user selections in Power BI Desktop using Power Automate.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
Hi @v-csrikanth, your solution worked, I appreciate your effort to help me out.
Also, I do have one more question, in the step Run a query against a dataset is there anyway
we can pass a dynamic value based on slicer selection (The same value we passed for dynamic file name)?
Here in the below example you can see the country name Japan is static, I want to pass the slicer selection value (the same selection we passed for file name change). Can you please help me with this?
Regards,
Karthick M
Thanks for the quick response, here the sample data
I want to name the file based on the country I select.
Currently I am naming the file with some prefix and and current timestamp
but I want the file name to be dynamic based on my country selection.
Hello @Karthick1006 ,
How do you want to change dynamically? Can you give details of your output please?
Like OpcoData_[VARIABLE1][VARIABLE2].csv etc.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.