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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
onepowerbiguy
Frequent Visitor

Embed a paginated report with RLS and CUSTOMDATA dataset shows error regarding CSDL.

I want to embed a paginated report into my client portal. I'm using a Service Principal to generate the embed token. I have a Dataset with RLS and using CUSTOMDATA I would like to pass the Categories available for the user (and apply RLS with those categories).

 

The thing is, I can make it work with a Power BI report, but when I try to use a paginated report I get this message:

onepowerbiguy_0-1682428679857.png

 

 

I'm really lost, I'm not sure what I'm missing. Please let me know if there is more information I should include.

 

POST request to generate embed token:

 

 

{
  "accessLevel": "View",
	"datasets": [
    {
      "id": "my_dataset_with_rls_id",
      "xmlaPermissions": "ReadOnly"
    }
  ],
	"reports": [
    {
      "id": "my_paginated_report_id"
    }
  ],
  "identities": [
    {
      "username": "user@contoso.com",
      "roles": ["role_by_category"],
      "customData": "category_1",
			"datasets": ["my_dataset_with_rls_id"]
    }
  ]
}

 

 

 

1 ACCEPTED SOLUTION
onepowerbiguy
Frequent Visitor

I solved the puzzle. The thing is, if you want to use paginated reports, the dataset can't use RLS. Instead, to achieve RLS-like behavior, you should use the username attribute in the embedToken request and the built-in field 'User!ID' in the report builder expression.

 

Here's an example of an 'embedToken' request:

Endpoint: https://api.powerbi.com/v1.0/myorg/GenerateToken

{
	"datasets": [
    {
      "id": "dataset_with_no_rls_id",
      "xmlaPermissions": "ReadOnly"
    }
  ],
 "reports": [
 {
  "id": "report_connected_to_dataset_id"
 }
 ],
 "identities": [
 {
  "username": "constraint_value",
	"reports": [
		"report_connected_to_dataset_id"
	]
 }
 ]
}

 

Also, it's important to note that in order to use this approach, you must connect to the dataset using the XMLA endpoint. Otherwise, it won't work.

 

View solution in original post

5 REPLIES 5
onepowerbiguy
Frequent Visitor

I solved the puzzle. The thing is, if you want to use paginated reports, the dataset can't use RLS. Instead, to achieve RLS-like behavior, you should use the username attribute in the embedToken request and the built-in field 'User!ID' in the report builder expression.

 

Here's an example of an 'embedToken' request:

Endpoint: https://api.powerbi.com/v1.0/myorg/GenerateToken

{
	"datasets": [
    {
      "id": "dataset_with_no_rls_id",
      "xmlaPermissions": "ReadOnly"
    }
  ],
 "reports": [
 {
  "id": "report_connected_to_dataset_id"
 }
 ],
 "identities": [
 {
  "username": "constraint_value",
	"reports": [
		"report_connected_to_dataset_id"
	]
 }
 ]
}

 

Also, it's important to note that in order to use this approach, you must connect to the dataset using the XMLA endpoint. Otherwise, it won't work.

 

This RLS way is not supporters when passing constraints as username while exporting paginated report. I could not found work around for that.

Jon-Heide
Microsoft Employee
Microsoft Employee

Could you confirm if the paginated report was created in PowerBI Report Builder, or in the web portal authoring experience? Exportable Formatted Data Tables (Preview) | Microsoft Power BI Blog | Microsoft Power BI

 

First, thanks for your response. And yes, It was created on the web portal.

After your question, I created a paginated report using Report Builder and error has gone! Thanks for that. Paginated report loads now, but the thing is, customdata is not applied.

 

CUSTOMDATA still not filtering my data in the paginated report (role_by_category has a very simple rls condition):

 [Category] = CUSTOMDATA()

 

If I run a Power BI Report, CUSTOMDATA works as expected (showing just category_1). But I can't replicate that behaiour in the paginated version.

 

Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.