
Hi,
I have a report of account receivables and 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 select a sales representative with a slicer and his data will be sent to his email.
I found a great video how to do something similar with formatting: 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 start like this:
// 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(The important parts I want to be dynamic is the first TREATAS function, where Sales representative A is selected and the number 10.
I got an advice to create a variable and pass dynamic content into the query text.
I just don't know how to do it.
Questions:
I pass the fields for dynamic content into the Power Automate button field Power Automate Data, right?
These are names of Sales representatives that are selected in the slicer (OZ), number of days and email of each Sales representative.
If I Initialize a variable to store the sales rep name in it and add dynamic content, it is suddenly all wrapped up in Apply to each.
I only want to send one email of one selected Sales rep, so is it ok?
I know it is quite chaotic, but I thought it would be simple to create a flow. I would like to make two parts of the query dynamic (sales rep name and number of days), then create a formatted html table following instructions in the video, then create a Send email step with a dynamic recipient based on the slicer selection and send him the table.
Is it possible for anyone to write some instruction or steps what I can do to achieve this? A youtube video with a similar theme would suffice. I just get lost in Apply to each when I add a dynamic content.