Hello,
I have a report in PowerBI that has 4 slicers. I need to send about 40 e-mails each week with different values for the filters. For example:
- Region - North, East, balkans, UK;
- Year - 22, 21 - it is a string value deliberately, but maybe I can convert it to something else if needed;
- Week - 40, 41, 42 etc. - it is a string value deliberately, but maybe I can convert it to something else if needed;
- Type - FTL, LTL.
For each Region I have 2 Types and each type has an e-mail. So Balkans FTL goes to email1, Balkans LTL goes to email2, North FTL goes to email3 etc.
But for each Region + Type I need to dynamically select current Year and current Week +1 and -1 (so 3 weeks in total). All of this works fine with the following custom URL:
https://app.powerbi.com/groups/me/reports/........./ReportSection?filter=RegionsTableFull/Region eq 'Balkans' and RegionsTableFull/LoadingYear eq '22' and RegionsTableFull/LoadType eq 'FTL' and RegionsTableFull/LoadingWeek in ('22.39', '22.40', '22.41')
As you can see all of this is hard set and does not change dynamically. I need to achieve the following 2 things:
1. Find a way to dynamically set the slicers;
2. Create a flow that will send e-mail based on the dynamic URL I will feed.
I do not have a problem to create 40 power-automates - for each Region + Type and only changing dynamically the Year and Week slicers. But I have no idea if this is possible and how. Any help would be appreciated.
Create an array variable that lists your permutations. I would handle the weeks in Power BI itself by setting "the last three weeks" as the default filter) - doing that in Power Automate is too complex.
Then you can iterate through the array and create the report URL separately with the appropriate filters. (Although at this point you would even be able to hardcode all the URLs)
Hello @lbendlin , thank you for the reply!
So you are proposing array variable in power automate, handle Weeks in Power BI and not including the Weeks in the URL?
Also, how can I use Power Automate to load the URL and send e-mail? I cannot seem to find this option to run the URL in any way. Ideally I want to send an image of the report, not an attached file.
You are describing three very different scenarios.
1. Include report URL in email. Easy to do, no restrictions
2. Include report image in email. Do you mean a subscription?
3. Include report in email. That requires ExportToFileInGroup and has tons of restrictions ( size, cadence, capacity limits etc ). Highly not recommended.
The end result is as follows:
Each team should receive an e-mail with an image of the report. The receiving team is based on Region+Type.
To be able to send different views of the report to different teams I think my only option is using Custom URL in Power Automate where I will hard-code 40 scenarios (20 teams * 2 types), but I want the Year to be selected as current automatically and Week to be selected as current, previous and next automatically. Because hard-coding changing factors is not possible.
Look into the Subscriptions feature.
@lbendlin Subscriptions give me the option to send the report only in current saved state. I cannot manipulate the Region, Type and Year/Date. So each team will receive all the data (and the same data) as it will not be filtered to their team.
Modify your requirement and go with the report URL (including the URL filters) . That is the simplest and most useful option. If you really must you can include a dataset query for some BAN specific to each recipient.
@lbendlin Can you point me in the right direction regarding the use of URL in Power Automate to take the report? How and where to put the URL so that I can send an e-mail with the report?
I will try to find how to work dynamically with Years and Weeks in Power BI, so that the URL does not include them.
You already know how to structure the URL (make sure to properly encode any special characters).
https://docs.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters
When you include the URL as text in your email it will automatically display to the email recipient as clickable.
@lbendlin I can easily send links in the subject, but I want the report itself, not the link to go to the team. With the "report itself" I mean an image of the report in an ideal situation. I know that in Power Automate I can attach the Power BI report as a file, but this does not work for me as well.
I mean an image of the report in an ideal situation
That is much more complex than you may think. You need to indicate which visuals in which report pages should be rendered by the rendering engine, and then you are pretty close to the process for the full report export to PPT or PDF. There are a lot of moving parts, a lot of resources involved, and a lot (A LOT) of limitations. Hence my recommendation to go with the URL approach instead.
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |