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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Power BI Embedded (App own Data)

Hi,

My company been using Power BI Pro for awhile, and recently I am exploring on PBI Embedded Solution to embed report into our portal for company performance etc. 

This reports usually has their own semantic models but in some scenarios we are required to get data from another models, which could be in the same workspace or in another different workspace. 

When the report has direct query to another semantic models, my embedded code as below return "400 Bad Request" with no detaills for me to troubleshoot one it reaches the line EmbedToken.GenerateToken.

Is the DirectQuery and embedded report not workable together? FYI I am using ServicePrincipal to gain access to PBI API Service, and a masteruser account for the powerbi login credentials.

Any help is highly appreciated, as i has totally 0 idea what is the issue here

 

 

 

 

public EmbedToken GetEmbedToken(Guid reportId, IList<Guid> datasetIds, [Optional] Guid targetWorkspaceId, bool? allowedit)
        {
            PowerBIClient pbiClient = this.GetPowerBIClient();

            // Create a request for getting Embed token 
            // This method works only with new Power BI V2 workspace experience
            var tokenRequest = new GenerateTokenRequestV2(

                reports: new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(reportId, true) },

                datasets: datasetIds.Select(datasetId => new GenerateTokenRequestV2Dataset(datasetId.ToString())).ToList(),

                targetWorkspaces: targetWorkspaceId != Guid.Empty ? new List<GenerateTokenRequestV2TargetWorkspace>() { new GenerateTokenRequestV2TargetWorkspace(targetWorkspaceId) } : null
            );

            // Generate Embed token

            var embedToken = pbiClient.EmbedToken.GenerateToken(tokenRequest);
            return embedToken;

        }

 

 

 

 

 

Status: Investigating

Hi @keithchai ,

 

Based on the above information, I would suggest opening a Support Ticket. If you are a Power BI Pro or Fabric licensee, you can create a support ticket for free and a dedicated Microsoft engineer will come to solve the problem for you. 
It would be great if you continue to share in this issue to help others with similar problems after you know the root cause or solution.

 

The link of Power BI Support: Support | Microsoft Power BI

For how to create a support ticket, please refer to How to create a support ticket in Power BI - Microsoft Power BI Community

 

Best Regards,
Community Support Team _ Caitlyn

Comments
v-xiaoyan-msft
Community Support
Status changed to: Investigating

Hi @keithchai ,

 

Based on the above information, I would suggest opening a Support Ticket. If you are a Power BI Pro or Fabric licensee, you can create a support ticket for free and a dedicated Microsoft engineer will come to solve the problem for you. 
It would be great if you continue to share in this issue to help others with similar problems after you know the root cause or solution.

 

The link of Power BI Support: Support | Microsoft Power BI

For how to create a support ticket, please refer to How to create a support ticket in Power BI - Microsoft Power BI Community

 

Best Regards,
Community Support Team _ Caitlyn