The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.