Forum Discussion

rohithkothaneth's avatar
rohithkothaneth
Icon for Resolver I rankResolver I
3 years ago
Solved

Dynamically export the report pages to PDF based on slicer value which is driving a Power Bi report

Hello,

 

I have a Power BI desktop report which is driven based on a column value "Client name" within a "Customer" table. Here the same column value is used as a slicer to populate visuals in the remaining pages of the same report. Basically Im trying to dynamically loop through values of a slicer, populate automatically the visuals remaining pages based on the value selected and extract all report pages for that value into a PDF file and then move on to the next value until it reaches the end of the slicer values. I'm using Power Automate to export the report in the PDF format, but haven't found a solution yet.

 

These are my report criterias

* I have multiple pages in my Power Bi report, the first page contains the slicers and an Power Automate execute button.
* The execute button would be triggered a flow in the Power Automate flow.
* Would want the value to loop through and apply the filter values in sequential order and extract the report pages to indicual PDF for the selcted slicer value and drop to a sharepoint site or folder specified.
* Power automate flow will need to end when the slicer value has been reached.

 

Could anyone please share the steps needed in the Power automate flow to achieve this scenario, your input is much appreciated.

 

Thanks,
Rohith

  • lbendlin's avatar
    lbendlin
    3 years ago

    It works for me - check your data model and your table and column spelling.  As you mentioned you can use the report URL for checking that it filters correctly. 

  • It was not working because, i had set the slicer to have a mandatory "Single selection" turned ON. Once I remove that, I was able to successfully test this by passing filter value as  a header in the URL. Same was dynamically generated in Power automate flow and passed within the filter parameter section for the "Exporting a PDF of the PBI report" connector in Power autiomate.

     

    https://app.powerbi.com/groups/******/reports/******/ReportSection*****?filter=<Table name>/<column name> eq '<column value>'

    Thank you for confirming that this solution works.

20 Replies

  • Add your filter column to the Power Automate visual and then use that data to specify the export filters in Power Automate.

    • rohithkothaneth's avatar
      rohithkothaneth
      Icon for Resolver I rankResolver I

      Thank you lbendlin for your response.
      when I add the filetre column to my power automate visual, i can use the value inside the power automate, but when i want the same filter values to go through a loop and apply back to report so thet visuals in the pages changes accordingly for me to export is where it is not working. Every time I loop through the list and try to apply different value to generate the visual and when tried to export the report into a PDF, the report output comes with the default selection and doesnt gets changes based on the filter value that i apply through power automate.

      Attached my flow that I cerated  for your reference.

      Thanks,
      RohithPower automate flow - 1Power automate flow - 2Power automate flow - 3

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        You didn't apply the report level filter(s).

  • What I mean by URL is the power BI service URL after passing filter values within the URL header.
    I did tried to passed in the rpeort filter section at the time of "Exporting a PBI report" but Power automate couldnt apply those column value back into the power Bi report into the slicer section to refresh the visual in the report pages.

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      It works for me - check your data model and your table and column spelling.  As you mentioned you can use the report URL for checking that it filters correctly. 

      • rohithkothaneth's avatar
        rohithkothaneth
        Icon for Resolver I rankResolver I

        It was not working because, i had set the slicer to have a mandatory "Single selection" turned ON. Once I remove that, I was able to successfully test this by passing filter value as  a header in the URL. Same was dynamically generated in Power automate flow and passed within the filter parameter section for the "Exporting a PDF of the PBI report" connector in Power autiomate.

         

        https://app.powerbi.com/groups/******/reports/******/ReportSection*****?filter=<Table name>/<column name> eq '<column value>'

        Thank you for confirming that this solution works.

  • banashree's avatar
    banashree
    Frequent Visitor

    I've a similar situation but my entity.object is giving error. 

  • Hi lbendlin  - Can you please help me like, I also have a similar requirement where If I select 3 customers in my filter, I should be able to export 3 differenct PDF's (1 per each customer). I'm able to do for each customer (single selection) but I'm not able to run the loop in Power Automate to execute one by one. 


    I have also posted my query here: https://community.fabric.microsoft.com/t5/Desktop/Export-the-Power-BI-report-as-PDF-format-for-selected-customers/m-p/3977864#M1271169 

    Any thoughts around this?

    • banashree's avatar
      banashree
      Frequent Visitor

      akhilduvvuru I've the filters too and similar situation but not able to extract PDF. How were you able to extract the PDF for 1 customer? Could you please share with me your flow? 

      Many thanks

      Banashree

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      Put your customer names in an array, then loop over the array and in each loop take the current customer name value and use it as a report filter for the extract request.

      • akhilduvvuru's avatar
        akhilduvvuru
        Icon for Helper IV rankHelper IV

        Thanks for your response lbendlin - I don't know I think I'm missing something and I'm not able to get that. Can you please share, if you have any screenshot for the same?

  • banashree's avatar
    banashree
    Frequent Visitor

    Hello lbendlin rohithkothaneth, akhilduvvuru my report page visuals are driven by the slicer values (names). Also, I have the names and email ids in another excel file. I want power automate to pick up each name from the excel and filter the page, extract the pdf and send the pdf via email. The email id is present as a 2nd column in the excel file. What could be the flow?

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      Not really clear what your hold-up is. What have you tried and where are you stuck?