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
MichaelWash
Helper I
Helper I

Creating an Embedded Power BI Report using a Dataset created by A Datamart?

Currently, if we call the API to create a report (passing in a Workspace and a Dataset) it will work for any dataset, except a dataset that was created by a Datamart

 

 

 

    private async void DisplayReportAsync()
    {
        var accessToken = await @PowerBIService.GetPowerBIAccessTokenAsync();
        var tokenCredentials = new TokenCredentials(accessToken, "Bearer");

        selectedWorkspaceID = selectedPowerbiWorkSpace.ToString();

        using (var client = new PowerBIClient(
            new Uri(_powerBISettings.ApiUrl),
            tokenCredentials))
        {
            var generateTokenRequestParameters =
                new GenerateTokenRequest(
                    accessLevel: TokenAccessLevel.Create,
                    datasetId: SelectedDatasetId,
                    allowSaveAs: true    );

            // For help see: https://bit.ly/2TbYjFl

            var tokenResponse =
                await client.Reports.GenerateTokenForCreateAsync(
                    new Guid(selectedWorkspaceID),
                    generateTokenRequestParameters);

            string CreateReportEmbedURL =
                colDatasets.Where(x => x.Id == SelectedDatasetId)
                .FirstOrDefault().CreateReportEmbedURL;

            objRef = DotNetObjectReference.Create(this);                                                                                                                                                                                                 

            await Interop.CreateNewReport(
                JSRuntime,
                PowerBIElement,
                tokenResponse.Token,
                CreateReportEmbedURL,
                SelectedDatasetId, 
                objRef
            );
        }
    }

 

 

 

 We get:

2022-07-12 16 17 20.png

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @MichaelWash ,

 

Datamart is in preview. So it is not support current time.Datamart is in preview. So at the current time it does not support power bi embeded.

 

For more details, you can see this official article.

Administration of datamarts (preview) - Power BI | Microsoft Docs

 

Please consider creating a composite model in power bi desktop and then using the new dataset. might be an choice.

Create reports using datamarts (preview) - Power BI | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

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

1 REPLY 1
v-chenwuz-msft
Community Support
Community Support

Hi @MichaelWash ,

 

Datamart is in preview. So it is not support current time.Datamart is in preview. So at the current time it does not support power bi embeded.

 

For more details, you can see this official article.

Administration of datamarts (preview) - Power BI | Microsoft Docs

 

Please consider creating a composite model in power bi desktop and then using the new dataset. might be an choice.

Create reports using datamarts (preview) - Power BI | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

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

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.