Forum Discussion
Changing Dashboard Data Source Dynamically
Hi , AutoJL
According to your description, you have created a button to trigger the refresh by Power Automate and now you want to relaize the dynamic update the M query to make the customer can refresh the data for themselves.
First of all, I'm sorry that I don't know much about Power Automate. But in terms of Power BI, the way you want to dynamically modify the M query to modify the data source is to create a paramter.
For how to create the paramter you can refer to :
Parameters - Power Query | Microsoft Learn
And we can update the paramter in Power BI Service by the UI interface and REST API:
Edit parameter settings in the Power BI service - Power BI | Microsoft Learn
Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
For my understanding, you can try to ask whether Power Automate can identify the current login user information, and then modify the corresponding Paramter to modify the M code according to the user information judgment, and then trigger data refresh. And i also search some document if it can help:
Call Power BI Rest APIs with Power Automate (vahiddm.com)
Solved: Get executing user in Flow - Power Platform Community (microsoft.com)
Secondly, there is another way for users to see their own data is RLS. You can import all the required data, and then configure corresponding RLS rules for different users, so that different users can view different data.
Dynamic Row Level Security with Power BI Made Simple - RADACAD
Row-level security (RLS) with Power BI - Power BI | Microsoft Learn
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly