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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
swapnil196
New Member

PowerBI Embedded SaveAs functionality Not Working

I am using the following code with the required permissions in the AD using service principal as mentioned in the document:

 

%script{src: "https://cdnjs.cloudflare.com/ajax/libs/powerbi-client/2.19.1/powerbi.min.js"}
%body
%h1 Sales By SKU Report

#reportContainer

:javascript
var models = window['powerbi-client'].models;
var embedConfig = {
type: "report",
id: "#{@report_id}",
embedUrl: "#{@embed_url}",
accessToken: "#{@embed_token}",
tokenType: models.TokenType.Embed,
permissions: models.Permissions.All,
viewMode: models.ViewMode.Edit,
settings: {
panes: {
filters: { visible: false },
pageNavigation: { visible: true }
}
},
filters: [
{
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "woah2_production organisations",
column: "id"
},
operator: "In",
values: []
}
]
};

var container = document.getElementById("reportContainer");
var report = powerbi.embed(container, embedConfig);

let saveAsParameters = {
name: "newReport"
};
report.saveAs(saveAsParameters);




I am getting the following error:

Something went wrongUnable to save the report

Please verify you have the right permissions or contact support. If you contact support, please prov...
  • Activity ID12bbde31-3f0e-441c-b827-a70643f064f8
  • Request ID328b84c9-0f9f-867e-421b-bd4d0aa22ae5
  • Correlation IDe8867d7f-47a9-08dc-4605-7f49933f2645
  • TimeThu Mar 20 2025 18:22:38 GMT+0530 (India Standard Time)
  • Service version13.0.25498.40
  • Client version2503.2.23230-train
4 REPLIES 4
V-yubandi-msft
Community Support
Community Support

Hi @swapnil196 ,

We noticed we haven't received a response from you yet, so we wanted to follow up and ensure the solution we provided addressed your issue. If you require any further assistance or have additional questions, please let us know.

Your feedback is valuable to us, and we look forward to hearing from you soon.

 

Thanks..

V-yubandi-msft
Community Support
Community Support

Hi @swapnil196 ,

Has your issue been resolved, or do you require any further information? Your feedback is valuable to us. If the solution was effective, please mark it as 'Accepted Solution' to assist other community members experiencing the same issue.

V-yubandi-msft
Community Support
Community Support

Hi @swapnil196 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank You.

V-yubandi-msft
Community Support
Community Support

Hi @swapnil196 ,

Thank you for reaching out to us on the Microsoft Fabric Community Forum. This error happens because of limited permissions, licensing issues, or workspace ownership problems.

 

1. Even if the Service Principal is properly set up, it needs the correct role in the Power BI workspace to save reports.

If it's set as Viewer or Member, change it to Contributor or Admin.

Reference: Workspaces in Power BI - Power BI | Microsoft Learn

2. For the Service Principal to use the saveAs() function, make sure API access is enabled in the Power BI Admin settings.

Apply this setting to the Security Group that includes the Service Principal.

Reference: Embed Power BI content in an embedded analytics application with service principal and an applicatio...

3. The saveAs() function only works for reports that are part of the workspace.

Make sure the report isn’t linked or shared from a different workspace. If needed, recreate the report within the workspace itself.

4. If you're using Power BI Pro, ensure the Service Principal has a Pro license.

If you're using Power BI Embedded, make sure the workspace is in Premium Capacity.

Verify that the workspace is assigned to Premium Capacity or confirm the Service Principal has a Power BI Pro license.

Reference: Power BI Premium Per User - Power BI | Microsoft Learn

 

5. Even if the Service Principal can access the report, it still needs Build permissions on the dataset to save changes.

If the permissions were updated recently, make sure to refresh them using the Power BI REST API.

As an alternative solution.

if the saveAs() function isn't working, consider using the Clone Report API. This API enables you to create a duplicate copy of the report.

 

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

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors