Power BI - Export Report and Email to Current User (Power Automate)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up everybody it's parker with bi elite i have an awesome video today showing you how to send pdf exports of your power bi reports directly to your email inbox i'm actually going to show you two different ways to do this one way is going to be via this button click here so as the logged in user clicks this email button it's going to send a pdf or jpeg export of this entire report directly to their email and i'm also going to show you how you can send it to other users not just yourself you can also set that up via button click within the power bi report for our first example if i click this button here it's actually going to send me an email with the pdf contents of this report and behind the scenes what's actually doing is it's calling a power automate or microsoft flow and it's going to export that report and send it to me via email so just to show you what the output is going to look like let's hop on over to my inbox and i have this nice email here basically says your power bi export awaits this is all customizable based on what we want to show here and i have this exportdemo.pdf if i open that up here is my exported power bi report so that's exactly what i want it's the full report not just a one page subscription like the default power bi subscriptions but it is the full export so let's go ahead and dive into how we can set this up there are a couple of pieces although it's not very hard so the bulk of this method is actually done in power automate so when we click this button as you can see with the tooltip it's actually calling a power automate flow via a git url so i'm going to come on over to power automate and show you the steps it's actually very easy only a few so this first one is when an http request is received so when we click that button we need it to do something the next step is to export to file for power bi reports this is a new action that was released by power automate back in september 2020 so just a month ago and it allows us to export our reports to pdf or powerpoint or png directly from power automate and then afterwards we need to do something with that export in this case we're going to send it to our email just a quick heads up before we really get into this this export to file for power bi report step is only going to work if you have a dedicated capacity meaning you have power bi premium or power bi embedded for the workspace that you're going to call this for this may not be as big of a deal as microsoft releases premium per user but we will see in the near future but now that we know that let's go ahead and dive into setting this up from scratch so i'm going to create a new automated flow here i will skip this here and bring us to our first page here to get us started here i just want to kick off this flow via a button press within power automates this is just going to allow us to start this very easily next thing let's add a step and let's search for the power bi actions we see the export to file for power bi reports which is still in preview since it just came out and the export to file for paginated reports we're going to stick to the normal power bi reports so let's click on that it's going to ask us for a few different pieces of information such as which workspace are we going to be loading this from i have this new workspace that's set up on embedded capacity called export demo my report let's see is also called export demo so i'm saying i want to export the report for the export demo file in the export demo workspace and then we have the option to set the export format such as pdf powerpoint or png i'll actually go ahead and change this one to powerpoint for the demo and then we have some other options such as bookmark name or bookmark state it looks like bookmark name is not currently supported so that'll be coming in the near future we also have the option to apply row level security within this as well i couldn't get this to work i'm not sure if this is fully implemented as of yet uh but if the role of security will work in the near future i will go ahead and update this video to work with datasets that use rolex security but for the purpose of this demo this is everything that we need so we just need to set which report that we are exporting and the export format so once we're done with that we just need one more step and we just need to send this to ourselves via email we also have the option to place this somewhere you know we could place this in sharepoint or post this somewhere else but sending it to email will be a nice test for us so i'm going to send an email notification v3 so at this point i'm just going to type in my email but we will set this up dynamically from our power bi report in a later step let's just send this to myself for now i'm going to call this export demo file and then body i don't need anything in the body really so i'm just going to say example body and then show advanced options this is where we're going to attach our power bi report export so if we scroll down we'll see attachment so i am going to go ahead and scroll down here we'll see file content in the dynamic content go ahead and click on that and then attachment file name you need to make sure you have an attachment file name if you have an attachment so i can call this whatever i want i'm going to call this my export or actually i'm going to call this my report export and it's very important that you give it a file extension so since this is a powerpoint report it will be pptx if you're exporting a pdf make sure you do dot pdf so with that that is all we need let's go ahead and click save and let's minimize that so now once we save this let's go ahead and test it out so you can say i'll perform the trigger action let's test and first time through it's going to ask you to sign into these things i'm already signed in so we're good let's go ahead and run our flow so our flow is currently running we can see that i've manually triggered the flow it's currently in the process of exporting that report to a file and then once it's done it's going to send me that email this takes about two minutes for each time that i run this flow so let's go ahead and give that just a second looks like the flow ran successfully let me go ahead and check my email export demo file so this is our new powerpoint report export so let's go ahead and open that up just make sure it worked correctly and there we go we have our power bi report export in powerpoint format so it's exactly what we want to happen now let's go ahead and change this first step so that we don't have to manually trigger it let's change it to use an http request so that we can call it from our power bi report specifically so we'll do that by clicking edit and i just need to delete this first step here and instead of that step i want to use the http request step when an http request is received let's go ahead and click on that at this point we need to click on show advanced options and let's change our method to use a get request instead of a post request a quick shout out to ashley boot who actually uh let me know that you could switch this method i was using post the entire time i'm gonna link ashley's power bi blog down in the description so now let's click save and this is going to allow us to view our http request url let's go ahead and copy our url and paste it in a new browser so this is the entire url that's going to kick off our flow so if we actually paste this url it's going to kick off our flow what we actually want to do is we want to add one little piece here that is going to allow us to know which email to send it to so without getting too in the weeds here all we need to do is type in and and let's write users this is arbitrary but i'm going to call this users equals and then let's type in parker bi elite dot com so this little extra bit of information is going to tell us where to send that email to but this will be dynamic from our power bi report so i'm going to go ahead and click enter there that is going to kick off our flow so we can actually see this if we go ahead and go to my flows let me just go ahead and open this up we will see that our flow is currently running so it's running with that email in that parameter there so i'm going to go ahead and edit this while it's still running and the last thing that we need to do here is instead of this two clause instead of actually writing out my email i want to use the little piece of information that we're passing into the url at the very end so we can do that by clicking on the box and typing in expression so from here we can type in trigger outputs and we want to then open up brackets here and type in queries sorry spell that wrong queries and then right after queries we want to type in dot users so this is basically saying grab the users at the end of that url and throw them into the two so once we've done that let's go ahead and click ok and everything else can be unchanged but what's great is now when we call our url with multiple people at the end such as parker bi elite ola bi elite even another user at bi elite it's going to send emails to each one of those people so with that let me go ahead and click save and let me go ahead and grab that url one more time so with that i'm going to come back over to power bi desktop and i'm going to show you how i set up this last piece in order to initiate this flow call so i've actually done that with this flow url here so firstly this is just an image just an image of a little mail icon so with this flow url so let me go ahead and click on that flow url this is just my microsoft flow url let me paste this in here that we just set up so right here this is going to kick off our flow but we want to add that same and users equals and then you can see here we are concatenating our user principal name and just as a refresher user principal name is going to return the email login that you're viewing within power bi service for example when i'm viewing my report in power bi service my user principal name is parker bialy.com if ola were to open this up her email would be ola bile.com so this report is always going to know who's looking at the report and then it's going to send the email to that person based on this string here and now our button is set up so that when a user clicks on it it will send that email directly to the logged in user so i'm probably not going to show off this functionality again since i've already done that let's just make sure that that email is still coming through yep we're looking good so one last thing we've set this up dynamically so that the report will be sent to the user that is currently viewing the report basically whoever clicks on the button but i also want to show you that you can send this to multiple people so me as parker i can send this to other people as well so i have that in another file here so let's say that i know that i have a few users that i might want to send this to i can go ahead and select who i want to send this to and we can see in my flow url these users are appended here on the end separated by a semicolon for example if i just click on myself i see that and users equals parker at billy.com let me go ahead and add ola and we see parker and then semicolon ola at biele.com and then as a final one testuser at bi elite.com so just in this way we can just append users at the end and send that email so let me go ahead and show you how i got this flow url just to show you the entire solution here so the only thing that i'm doing is i have a users table in those emails and i'm concatenating it with concatenatex and a semicolon and that is throwing it onto the end so once i have that i can actually click this button and it's going to send that report to all three of those users so i'm actually going to give that just a second and i will show you the final output and here's my final output i got my email and we see in the to section here parker ola and test user billy.com so i was able to send that email to everyone that i selected so it's really nice in order to send to multiple users or adjust yourself as the logged in user so i hope you like this trick i had a lot of fun setting this up it's also fun to use power automate in conjunction with power bi using the entire power platform is a very fun process to set up so if you like this video make sure you click the like button and subscribe to our channel you can also check out our training over at training.billy.com we have some awesome courses on power bi dax and alteryx make sure you check that out and i'll see you in the next video
Info
Channel: BI Elite
Views: 78,557
Rating: undefined out of 5
Keywords: Power BI, Data Analysis, Data Visualization, Data Science, Business Intelligence, BI, Microsoft, Dashboard, Report, power bi export to powerpoint, power bi export to pdf automatically, power bi export to ppt, power bi embedded export to pdf, power bi email reports, power bi email pdf report, power bi email subscription, power bi email button, power bi automated email report, power bi trigger email, power bi schedule email reports, power bi email export, power bi email exported pdf
Id: uwjOFYz-FxM
Channel Id: undefined
Length: 12min 22sec (742 seconds)
Published: Tue Oct 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.