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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Petanek333
Helper III
Helper III

Dynamic value in a query used in Power Automate

Hi,

I have a report of account receivables and in the end I want to send 4 different tables via email to different sales representatives. 

Understandably I want to send each sales representative a table of only their customers. 

I found a great video how to do this in Power Automate: https://www.youtube.com/watch?v=tbNvNk11sXM 

Jason uses "Run a query against a dataset" option and copies the query of specific visual from Performance analyzer. 

My query would like this (I deleted all parts of the code that are not important):

// DAX Query
DEFINE
  VAR __DS0FilterTable = 
    TREATAS({"Sales representative A"}, 'Reps table'[Rep])

  VAR __DS0FilterTable2 = 
    FILTER(
      KEEPFILTERS(VALUES('My measure'[Measure])),
      ''My measure'[Measure] = 10
    )
  VAR __ValueFilterDM1 = 
    FILTER(
"these are not important parameters"
    )

The only important part is the first TREATAS function, where Sales representative A is selected. Suppose I have 5 Sales representatives, I could create 5 static power automate buttons and each of them would contain a query for the specific sales representative. But is there any way how to make one dynamic flow in power automate that would change the query parameters based on a slicer value selected? I don't know if I can use a variable in a power automate query.

3 REPLIES 3
Anonymous
Not applicable

Hi @Petanek333 ,

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.

 

Best regards,
Community Support Team_Binbin Yu

Hi @Anonymous  I did not have time to try it yet. I hope to get to it in a couple of days and will respond hopefully with accepting as solution 🙂

AlexisOlson
Super User
Super User

You can pass dynamic content into the DAX Query to use as the string for the sales representative. It might look like this if it's coming from a variable:

AlexisOlson_0-1672521385221.png

 

If you have trouble, I'd recommend the Power Automate forums rather than the Power BI forums for troubleshooting how to make the dynamic content work.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.