POWER BI QUESTIONS

How to Apply Report Filters to Automated Power BI PDF Exports

Your East region manager needs her monthly sales PDF. Before you can send it, you have to select her region, check the month and export the report again.

PBRS can save those reporting choices with the PDF delivery, so preparing her next report does not mean starting over with the slicers.

  
The regional sales report

A monthly report that feels like it was made for her

Picture the end of the month. You have been looking into a dip in West’s sales when the East manager asks for her PDF. She wants to review her team’s results before meeting with the branch managers tomorrow.

You switch the region to East, select the completed month and check the totals before exporting. None of that takes very long on its own. But you repeat it for the next manager, then repeat it all again next month. Each time, someone has to remember which view belongs to which person.

With PBRS, you can save East’s selection in the job that prepares and delivers her PDF. The recurring export then uses that configured view, rather than depending on what you last happened to be investigating in your browser.

There are two choices to get right. Her region stays East, but the reporting month needs to move forward. Once you have dealt with both, she can receive a report that is ready for her meeting without first asking you to recreate it.

Illustrative monthly sales PDF identifying the East region and reporting month.

Help her recognise the report

A heading such as “East sales — October” lets the manager check the region and month at a glance. Use the actual reporting period in the heading so an older file is easy to spot.

  
Your options

Decide what stays the same next month

If this is an occasional request, selecting the intended view and making a supported manual PDF export may be enough. Open the resulting file before sending it, so you know it contains the view you meant to share.

For our manager’s monthly report, the repeated preparation is the part worth automating. Keep East as a fixed selection in her PBRS schedule. Then decide how the date selection should work: perhaps it should always show the last completed month, or perhaps your reporting process supplies the period explicitly.

A monthly schedule tells PBRS when to run. It does not turn a fixed October filter into November. Use a supported relative-date selection where it fits, or arrange for the period to be updated as part of the job’s preparation.

If more managers ask for their own copies, you can move to a documented data-driven setup that matches each recipient with the appropriate region. Start by getting East’s report right; it gives you a clear example of what each person should receive.

Why a filtered browser view may export differently

The export route determines how filters are supplied. PBRS has its own filter fields and types. Microsoft’s standard ExportTo API accepts URL-style expressions in reportLevelFilters. These formats are different, so copying an expression from one into the other is not enough.

Saved slicers and bookmarks can narrow the result further. If an East PDF is empty, check whether another selection is excluding East’s records before assuming the regional filter was ignored.

Microsoft’s interactive PDF Current Values option does not respect service URL filters. Seeing East in a browser opened through a filtered URL therefore does not establish what will appear in the exported file.

For a paginated report, use the report’s named parameters instead of standard-report filter syntax. The Microsoft Export To File reference distinguishes the two report configurations.

Keep access controls in place

A filter selects what the PDF shows. It does not decide who is entitled to see the underlying data. Keep the correct account permissions and row-level security alongside the reporting setup.

  
Set it up

Prepare and check East’s first PDF

Begin with the sales report in PBRS and a test destination. In the schedule’s Report Filters settings, add the field that identifies the region. For this example, the model has a table called Region and a text column called Name. Your report may use different names, so select its actual field.

Choose the appropriate data type, filter type and operator, then set East as the value. The Basic Filter dialog below shows where those choices belong.

PBRS Basic Filter dialog with field, String data type, In operator and values controls.

Next, add the reporting-period selection you agreed on. Preview the report and look at it as the manager will: does the heading show East and the right month, and does a familiar sales figure agree with the report you would have prepared by hand?

Choose PDF for the output and add the test email or file destination. Run the job and open the delivered copy. Compare East’s total with the intended report view, and check that a record you know belongs only to West is absent. Calling the attachment “East.pdf” helps someone find it, but the contents are what establish that the filter worked.

Try the next month before leaving it to run

Check how your chosen date setup will behave when the reporting period advances. East should remain selected, while the dates move to the period the manager expects. Once the test file is right, set the approved recipient and monthly timing.

Keep that first correct PDF as a reference. If someone later renames a model field, changes the report’s date logic or takes over the region, you have a useful starting point for checking the revised delivery.

Ask the manager to review one copy

She may use a particular total or page to prepare for her meeting. Checking the first PDF with her helps you catch a missing detail before it becomes a recurring frustration.

  
For developers

Let an application request the right regional report

If the manager requests her report through your application, that request can start a saved PBRS regional job. She chooses the report she needs; PBRS uses the configured filters to prepare the PDF and deliver it.

Your application must check that she is entitled to request East’s figures. If it also changes the reporting period or region, keep those choices separate from other users’ jobs so a West request cannot alter the report East is about to receive.

API example: apply East’s filter to a PBRS schedule

For a model with a table named Region and a text column named Name, the following fragment selects East. Replace the field and value with those from your report. This is the filter portion of a schedule definition, not a complete update request.

{
  "BasicFilters": [{
    "TargetField": "Region.Name",
    "FieldDataType": "String",
    "FilterLevel": 0,
    "Operator": "In",
    "BasicValues": ["East"],
    "IgnoreBlankDataDrivenInserts": false
  }],
  "AdvancedFilters": []
}

TargetField uses Table.Column notation. FilterLevel: 0 selects a report filter, and BasicValues contains the text values as an array.

To update an existing Power BI schedule, UpdateForPowerBI requires the complete intended definition and its uniqueid. Preserve the other filters, destinations and destination IDs. Follow the schedule API guide, then retrieve the saved job with Get?Id={uniqueid} to check what was stored.

Execute the checked job and retain its ExecutionId with the region and reporting month. The execution guide explains how to monitor the result. Confirm the delivered PDF as well as the job status.

Handle a blank or unapproved region before submitting the request. Silently dropping a missing regional filter could produce a broader report than the recipient should receive. Test that case, and concurrent East and West requests, alongside the normal delivery.

If your application uses Microsoft’s ExportTo API instead

That API uses powerBIReportConfiguration.reportLevelFilters, with an expression such as Region/Name eq 'East'. It supports one report-level filter object; compatible conditions belong together within that expression. Table and field names are case-sensitive, and text values need apostrophes while numeric values do not.

This is a separate implementation from the PBRS filter above. Your application also needs to monitor the export, retrieve the completed file and deliver it. Check the selected API’s access and capacity requirements before choosing that route.

Make the request easy to trace

Record the region and month with the job reference. If the manager asks about October’s PDF, a colleague can find the right run without opening every file in the folder.

  
Your next step

Have her report ready for the next meeting

Next month, the East manager opens a PDF with her region, the completed reporting period and the figures she needs for her branch meeting. You can carry on investigating West’s sales without having to stop and rebuild her view first.

Start with that one regional delivery and get it right from filter selection to the received file. When other managers need the same service, explore personalized Power BI distribution. The Power BI Report Automation guide shows how to bring those deliveries into your wider reporting routine.

Download the PBRS Internal Evaluation Guide

Contributors:

Christian Ofori-Boateng

Christian Ofori-Boateng

CEO, ChristianSteven Software