Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MattCalderwood
Responsive Resident
Responsive Resident

Export to file - Power BI Report with Filters / Parameters

HI All,

I am looking at the new (currently in preview) API for exporting Power BI reports as images/pdf files.
https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup 

There currently isn't a way to specify Filter/Slicer values for Power BI Reports!
This feels like a big omission to me, especially considering the inclusion of Bookmark capabilities.

Is there a published roadmap for this API endpoint anywhere AND/OR does anyone know if we can expect to see filter options anytime soon?

The API is unusable for many scenarios without this.
I am keeping my fingers crossed that it arrives soon.

Cheers,
Matt

1 ACCEPTED SOLUTION

Hi @vmakhija 

The documentation currently states that the Bookmark name (whilst accepted as a parameter) is not currently available.
https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile#pagebookmark

The only way to update output via bookmarks, is to pass in the bookmark state.
And the only way that you can get the bookmark state (that I know of) is via the JavaScript API. https://github.com/Microsoft/PowerBI-JavaScript/wiki/Bookmarks#capture-and-get-a-current-view-as-a-b... 

The 'capture' function will return a single string value that represents the bookmark state. You can then pass this into the API.

This is far from ideal... but I think the export API endpoint is still under preview, so will likely change quite a bit.

The idea I raised for adding missing functionality to this API has also moved into the planned phase. So hopefully, it won't be too long before these missing features are available. https://ideas.powerbi.com/ideas/idea/?ideaid=0e056f7d-34b4-4778-974f-929228effcdd

Cheers, Matt

View solution in original post

25 REPLIES 25
shubh43
Regular Visitor

Hi,

 

I'm trying below mentioned request for export but API is throwing error, I appreciate if somebody help me, i need to solve this ASAP.

 

API Endpoint:

https://api.powerbi.com/v1.0/myorg/reports/{reportid}/ExportTo

 

Request:

{
    "format""PDF",
    "powerBIReportConfiguration": {
        "settings": {
            "locale""en-US",
            "excludeHiddenPages""false"
        },
        "defaultBookmark""H4sIAAAAAAAAA+1deW8bR5b/KgSB3cwASlD3kf9kyd4Em2S8VpLdwSAIXlW9knpCsjnNpmxN4O++1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1JIHaPj4K3jW4wnqpMfFEhNIOhQGCPFevtY2hvRTJOqwO0k8YbxaJud713OwUYVMI1Gb7xB54nzYvEBb5u45tvw5LT6st7FdDiE4ub36rj5ah9pJ/e88Hia3X6JZ7kbbzxzdbHbd3V24LHXiGwpgXvYBf1ppG11OHHZdvrq5n+mWNzkI3Z+bk/ToDmjZ6/EKyrM6Sk/P2f87PUb+Yq9sXvajryZdlr3zpklNATkiAjUEWW2ADetouAJ2rykKE1yzNJuc8hYclcymkhjAgKWYDi5iI4AInhy5ZJXrtc4nzxxhKVHdb+Mc6xmh7esj+if/iCrZecerR1hk0HmkyrmLaE/xOKyjnQDlFBLaty8KcPmfh7q21gbwuIc5jw9EfL3o6/6Lc8fl+zOvxXdLsXQ7MlPsTOVVnovhJJINATatSYhg6IkOcQQUWoduKxirRdtzXenBx2AOW/xYbUXZc8PjnQiKUdS1QlJGpBywZgy67Ov5dGioMxEkxxQCt1BoUWzRezplOeCesp9ICkVk9S7rl/INiCV8On9BLn2EIPDnW4Bvu+tu5WDnmzgPT4/qSKq8wFKux17j0SzgrblZaAniy0f10oGGY4WE7QtNlziqJH1I3i4M7l9Gd+T2Nk92XWoQp7jMO81D80VIptzdnYIpElnOJjF5Y96nJTJrMqLWqsXdbs1/UcYTPDJMPqT7LPBbIpRg3BGSycTyPmUvOzvyyXHDxo1Jvtx8ZjPp+VkDB7fwggXGF8SPYwChjUmVxbTO4v7+PH/AUUCsz6fsAAA"
    }
}
 
 
Response
 
{
    "error": {
        "code""BadRequest",
        "message""Bad Request",
        "details": [
            {
                "message""Error converting value \"H4sIAAAAAAAAA+1deW8bR5b/KgSB3cwASlD3kf9kyd4Em2S8VpLdwSAIXlW9knpCsjnNpmxN4O++1QclSuLRJimKlokkCNVdXf2u+r2jjv6zH7LJeAA3P8EQ+9/2X+X5H0Mo/ujR/kl/dP+a4SQSTkOgjnmtSVCUpFb5uMzy0aT/7Z/9EopLLH/NJlMYVB2mi//47aQPg8FbuKz+ijCY4El/jM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GwpgXvYBf1ppG11OHHZdvrq5n+mWNzkI3Z+bk/ToDmjZ6/EKyrM6Sk/P2f87PUb+Yq9sXvajryZdlr3zpklNATkiAjUEWW2ADetouAJ2rykKE1yzNJuc8hYclcymkhjAgKWYDi5iI4AInhy5ZJXrtc4nzxxhKVHdb+Mc6xmh7esj+if/iCrZecerR1hk0HmkyrmLaE/xOKyjnQDlFBLaty8KcPmfh7q21gbwuIc5jw9EfL3o6/6Lc8fl+zOvxXdLsXQ7MlPsTOVVnovhJJINATatSYhg6IkOcQQUWoduKxirRdtzXenBx2AOW/xYbUXZc8PjnQiKUdS1QlJGpBywZgy67Ov5dGioMxEkxxQCt1BoUWzRezplOeCesp9ICkVk9S7rl/INiCV8On9BLn2EIPDnW4Bvu+tu5WDnmzgPT4/qSKq8wFKux17j0SzgrblZaAniy0f10oGGY4WE7QtNlziqJH1I3i4M7l9Gd+T2Nk92XWoQp7jMO81D80VIptzdnYIpElnOJjF5Y96nJTJrMqLWqsXdbs1/UcYTPDJMPqT7LPBbIpRg3BGSycTyPmUvOzvyyXHDxo1Jvtx8ZjPp+VkDB7fwggXGF8SPYwChjUmVxbTO4v7+PH/AUUCsz6fsAAA\" to type 'Microsoft.PowerBI.ServiceContracts.Api.V1.PageBookmark'. Path 'powerBIReportConfiguration.defaultBookmark', line 8, position 6257.",
                "target""request.powerBIReportConfiguration.defaultBookmark"
            }
        ]
    }
}

Hi,

 

Bookmark is an object with name/state. Since you are using bookmark state I believe you should try something like this:

 

Request:

{
    "format""PDF",
    "powerBIReportConfiguration": {
        "settings": {
            "locale""en-US",
            "excludeHiddenPages""false"
        },
        "defaultBookmark": {
            "state": "H4sIAAAAAAA..."
        }
}
 
Thanks,
Amos

 

 

Thanks for qucik reply, that workaround worked for me

KiranHosakote
Helper V
Helper V

Hi @orygreg2@MattCalderwood,

Here's a solution. BI Helper bihelper.tech automates the generation of  PDF / PPTX reports from Power BI (Pro and Premium), with slicers and filters applied either in batch mode or at runtime. Our implementation bypasses the limitations of the Power BI API endpoints. 

In BI Helper, you can select pages to print, schedule and generate multi-page PDF / PPTX reports and email them to your users. Our users routinely run hundreds of reports of up to 30 pages each, with the process fully automated from report generation to delivery. 

BI Helper is simple to configure and use with your Power BI reports and dashboards. It is secure and scalable and we offer a 14 day free trial. Test it out and let us know how it works. 

Kiran Hosakote

BI Helper

Anonymous
Not applicable

Dear Sir, I really appreciate your answer. I will try your product for sure and once it solve my printing needs I'm more than happy to buy it 🙂

KiranHosakote
Helper V
Helper V

Hi @MattCalderwood,

 

We have an independent solution to the PDF export problem. We've built a tool called BI Helper https://bihelper.tech/ to automate the generation of  PDF / PPTX reports from Power BI (Pro and Premium), with slicers and filters applied. Our implementation bypasses the limitations of the API endpoints. 

With BI Helper, you can select report pages to print, schedule and generate multi-page PDF / PPTX reports and email them to your users. BI Helper has an option to include matrix and table visuals as Excel files, and lots of other advanced features. Our users routinely run hundreds of reports of up to 30 pages each, with the process fully automated from report generation to delivery. 


BI Helper is simple to configure and use with your Power BI reports and dashboards. It is secure and scalable and offers a 14 day free trial. Try it out and let us know how it works for you. 

 

Kiran Hosakote

BI Helper

FinDataAnalyst
New Member

Hey, 

 

@MattCalderwood , did you solve your issue? 
Workaround: Adding a dimension table to the row level security feature (the dimension you would like to filter on), and then filtering using the identities paramenter and then just looping on that should solve the issue.  🙂

latearrival
Advocate I
Advocate I

I feel your pain Matt!  I just spent 3 days writing code to use the API to export a report to PNG. I just got to the filtering bit - we need to create a separate image for each filter value - and have hit a brick wall. Did you find a workaround?

Hi @latearrival 

No workaround that I know of.
Depending on how many filters you have and what your model looks like, you might be able to use the Bookmarks feature?

I attempted to work out if we could generate bookmark state at runtime, then apply it to a PDF/PNG export, but this was a non-starter.

Looking at the idea site though... looks as though this has progressed to 'Under Review'.
So I guess we will have to wait.

Hey @MattCalderwood, I'm going to see if I can use Bookmarks until filters are supported.  I see in the Export to File doco that you can pass in a PageBookmark specifying "The bookmark to apply on a single page. Provide name or state, but not both", but that the bookmark name is currently not supported. Do you know how I can find out the "state" value for a given bookmark?

I went looking at options for this... The only oneI can find (the one I was previously experimenting with) was via the JavaScript embedding API. https://github.com/Microsoft/PowerBI-JavaScript/wiki/Bookmarks

The section at the end shows how to capture a bookmark programatically. The resulting object then holds the bookmark state.

// Capture the current view
let capturedBookmark = report.bookmarksManager.capture();

// Applied previously captured state
report.bookmarksManager.applyState(capturedBookmark.state);

 

I tried to work out how this state object was structured, in the hope I could dynamically create it in C#... but I didn't get very far.

As I mentioned before... If you only have a small number of filters and bookmark states that you need to capture, then you could use this method to fetch those states and reuse them as many times as you like. But as soon as you want to do anything really dynamic... you hit a bit of a blocker.

I am keeping my fingers crossed for quick updates to the API to add the parameters. 😀



Looks like the Idea has moved to 'Under Review'.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/40060261-add-filter-options-to-th...


I will update this thread as things progress.
Feel free to go and up-vote! 😀

@MattCalderwood 

@latearrival 

I am using the REST APIs for ExportToFile in my Power Automate flow.

I can export the PDF with no issues in a normal use case, but next I want to try out exporting a PDF with a particular bookmark.

Use case is - I have 5 user groups and I will create 5 bookmarks (one for each).

Will send the PDF in an email to each of them as per their individual bookmarks.

 

However, when I try to put the bookmark name in my flow, it doesn't work.

Here is how my flow looks -

vmakhija_0-1596722370342.png

 

The error I get is -

{
  "error": {
    "code""BadRequest",
    "message""Bad Request",
    "details": [
      {
        "message""Error converting value \"Group1_bookmark\" to type 'Microsoft.PowerBI.ServiceContracts.Api.V1.PageBookmark'. Path 'powerBIReportConfiguration.defaultBookmark', line 1, position 74.",
        "target""request.powerBIReportConfiguration.defaultBookmark"
      }
    ]
  }
}
 
Appreciate if you can provide any inputs in case you have any ideas around this use case?
 
Regards

Hi @vmakhija 

The documentation currently states that the Bookmark name (whilst accepted as a parameter) is not currently available.
https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile#pagebookmark

The only way to update output via bookmarks, is to pass in the bookmark state.
And the only way that you can get the bookmark state (that I know of) is via the JavaScript API. https://github.com/Microsoft/PowerBI-JavaScript/wiki/Bookmarks#capture-and-get-a-current-view-as-a-b... 

The 'capture' function will return a single string value that represents the bookmark state. You can then pass this into the API.

This is far from ideal... but I think the export API endpoint is still under preview, so will likely change quite a bit.

The idea I raised for adding missing functionality to this API has also moved into the planned phase. So hopefully, it won't be too long before these missing features are available. https://ideas.powerbi.com/ideas/idea/?ideaid=0e056f7d-34b4-4778-974f-929228effcdd

Cheers, Matt

Hi,

I'm posting here because I don't know if there has been an update to the docs since the original post was made.
I also have a requirement where I would like to call "ExportTo" using the REST API from a Javascript AJAX request.
In the docs (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile) it says that request body accepts powerBIReportConfiguration which in turn accepts a reportLevelFilters which is of type ExportFilter.
According the docs an ExportFilter is a string in the format as described under the article https://docs.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters
 e.g.

?filter=Store/Territory eq 'NC'

I've tried various permutations trying to get this to work but I never get a filter applied.
Does anyone know...

- Should this filter actually be working now?
- What format the filter should be
- An example of it in code

Here's an example of an attempt that DOESNT work for reference:

 

var url = "https://api.powerbi.com/v1.0/myorg/reports/" + reportId + "/ExportTo";
$.ajax({
"type": "POST",
"url": url,
"headers": {
"Authorization": "Bearer " + accessToken
},
"data": {
"format": "pdf",
"powerBIReportConfiguration": {
"reportLevelFilters": [{ "filter": "products/ProductName eq 'ExampleProductName'" }]
}
}
})

Cheers,

Craig

We went down a similar path.  Ultimately, the only solution we found is that the published report CANNOT have any report-level filters applied when published.

Hi @DavidSkyles,

 

We have a much simpler solution for this often requested feature.  We've built a tool called BI Helper https://bihelper.tech/ to automate the generation of  PDF / PPTX reports from Power BI (Pro and Premium), with slicers and filters applied. Our implementation bypasses the limitations of the API endpoints. 

With BI Helper, you can select report pages to print, schedule and generate multi-page PDF / PPTX reports and email them to your users. BI Helper has an option to include matrix and table visuals as Excel files, and lots of other advanced features. Our users routinely run hundreds of reports of up to 30 pages each, with the process fully automated from report generation to delivery. 


BI Helper is simple to configure and use with your Power BI reports and dashboards. It is secure and scalable and offers a 14 day free trial. Try it out and let us know how it works for you. 

 

Kiran Hosakote

BI Helper

Hi @craigbenstock  -  Any chance you've figured this out??  I'm in the same boat - wanting to apply a filter at runtime when exporting the report as PDF.  I haven't been able to find a working example.

Thanks, Greg

Hi @orygreg2  and @craigbenstock

If you're still looking, here's a solution.

BI Helper https://bihelper.tech automates the generation of  PDF / PPTX reports from Power BI (Pro and Premium), with slicers and filters applied either in batch mode or at runtime. Our implementation bypasses the limitations of the Power BI API endpoints. 

In BI Helper, you can select pages to print, schedule and generate multi-page PDF / PPTX reports and email them to your users. Our users routinely run hundreds of reports of up to 30 pages each, with the process fully automated from report generation to email delivery.

Do take a look at https://bihelper.tech and let us know if you need more information.

Kiran Hosakote

BI Helper

Hi @craigbenstock ,

Hope this helps you/somebody.  Kept digging and finally have a working copy - this is from a PowerShell script - so it has the double-quotes preceded by a qualifier:

$body = "{ format : `"PDF`",
powerBIReportConfiguration : { reportLevelFilters : [{ filter : `"TableName/FieldName eq 'SomeValue'`" }]} }"

. . .which looks same/similar to your version.

I used the "Try It" option from the MS documentation page to tweak the body formatting until I got a 20x response code:

https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup

And here's the page documenting that filtering is possible - it's too bad they don't provide a full, soup-to-nuts working copy that includes a filter example:

https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to#filters

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.