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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Exporting PBI report to pdf file via REST API - cannot load model

Hello, 

 

I'm trying to export pbi report to pdf file using REST API 😞https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/ExportTo) and so forth.

and I successfully can when the report has no RLS defined on it.

If it does then the pdf file generated contains error message, such as:

"Cannot load model", etc., please view attachment below.

 

Bachatero_0-1640096953534.png

 

This is the body format that I'm sending with my request when trying to export a report with no RLS:

$body = '{ format : "pdf" }'

 

But when a report with RLS is sent to be exported then I need to append identity within the body, otherwise it would complain that no identity was specified.

 

$body = '{
format : "pdf",
powerBIReportConfiguration : {
identities : [{ username : "myuser@ourdomain.com", roles: [ "role" ], datasets : [ "a5f0xxx--yyy-zzz-zzzf1da6916" ] }]
}
}'

 

I've tried multiple users, all of them having assigned the role and all of them capable of viewing the PBI report itself including data when accessing it via PBI Service.

 

Any ideas, please, what should be set for this to work?

 

Thank you.

 

Marcel

2 ACCEPTED SOLUTIONS
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

I need to check with you if the report can be displayed properly inside the service. Also is RLS properly configured in the service (dateset-security-role)?

 

This is the relevant document, hope to help you:

https://community.powerbi.com/t5/Service/Export-API-with-dynamic-RLS/m-p/2071903 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi, 

 

the issue has been resolved by specifying correct role name that would match the one specified in PowerBI Service Row-Level Security tab, please, see below.

 

Thank you very much.

 

Marcel

 

rls_security.png

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, 

 

the issue has been resolved by specifying correct role name that would match the one specified in PowerBI Service Row-Level Security tab, please, see below.

 

Thank you very much.

 

Marcel

 

rls_security.png

v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

I need to check with you if the report can be displayed properly inside the service. Also is RLS properly configured in the service (dateset-security-role)?

 

This is the relevant document, hope to help you:

https://community.powerbi.com/t5/Service/Export-API-with-dynamic-RLS/m-p/2071903 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

When you have RLS configured you would need to create an Admin role or a role without any restrictions to allow certain users to see all the data. Maybe you can try exporting the PDF with a role that allows to see all the data.

 

If I have misunderstood, please feel free to communicate.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors