Forum Discussion

Abhishek_Jain's avatar
Abhishek_Jain
New Member
2 years ago

Integrate or Embedded Power BI dashboard using API to display data

Hi,

For the deployment of Power BI in our .net application dashboard, we require your favor.

 

Scenario of application works as

User login -> Select the Client -> Dashboard appear of the Selected Client

In our .net application User get login through email_id and then select the Client

 

Using Database SQL

                                User, Client and their mapping are in Common database, And Clients have own database

 

Data is picking up through API for the selected Client because some backend calculation in done by stored procedure stored in individual clients database.

 

 

As we are struggling on following points,

  1. We want to use the above APIs for picking up the data without storing anywhere else, as SP called based on Client.
  2. While providing API, asking for a Key (Refer the screenshot). Let us know about what key have to be used.

 

 

  1. Based on User login, how we select the client in Power BI to call API
  2. Is it possible to embed the Power BI in our application?
  3. Do we required Power BI Licenses to display the Power BI dashboard to every application user?

 

Kindly let us know the best solution for these struggling points.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Abhishek_Jain ,

     

    1. Using APIs for Data Retrieval:
    To retrieve data without storing it elsewhere, you can leverage Power BI Embedded. This feature allows you to embed Power BI reports directly into your application using APIs.

    2. API Key for Power BI:
    When you create an application that embeds Power BI reports, you'll need an access token to authenticate your application with the Power BI service. The access token serves as the API key.

    3. Selecting the Client Based on User Login

    To dynamically select the client based on user login, you can leverage Row-Level Security (RLS) in Power BI. RLS allows you to control data access based on user roles, which you can define based on the client selection in your application.

    4. Embedding Power BI in Your Application

    Yes, it is entirely possible to embed Power BI reports and dashboards into your application. Power BI provides a comprehensive set of APIs for embedding content for your application users. You'll want to look into Power BI Embedded, which is designed for this purpose.

    5. Licensing Requirements

    To display Power BI dashboards to your application users, you will need to consider licensing. If you're using Power BI Embedded, you'll be working with Azure capacity-based licensing, which doesn't require individual Power BI licenses for each user viewing the reports.

     

    For more details, please refer:

    Embed Power BI content in an embedded analytics application with service principal and an application secret 

    How to Integrate Power BI Reporting into .NET apps | Microsoft Power BI Blog | Microsoft Power BI

    Get started with Power BI Embedded - Power BI | Microsoft Learn

    Sign up for Fabric and Power BI licensing for users in your organization. - Power BI | Microsoft Learn

     

    Best Regards,

    Neeko Tang

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

    • Abhishek_Jain's avatar
      Abhishek_Jain
      New Member

      Hi Anonymous 

      Thanks for your suggestions.

      So,  to Embed the Power BI Report, We have to create it.

      To create Power BI report, we have to use API to call the data based on client. But how we know for which client data need to show and How we select it. Beacuse a user has access of multiple client. And what parameter we need to pass in the API and How will we pass that value.

      When we create a Power BI Report then we need to follow the suggested steps.

       

      Kindly suggest how to call API to display required of particular Client, so that we can create power BI 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Abhishek_Jain ,

         

        1.Use Power Query parameters to dynamically change the data source in your Power BI report. This allows you to set up a single report template that can switch between different clients' databases. You can define parameters for the database name, server, or any other part of the connection string that changes between clients.

        Change the Source of Power BI Datasets Dynamically Using Power Query Parameters - RADACAD

        2.When using the Power BI REST API, you can update the parameters of a dataset to change the data source dynamically. For example, if you have a parameter for the client's database name, you can use the Update Parameters API to set this parameter to the desired client's database before refreshing the dataset.

        Datasets - Update Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Learn

        How do I connect to REST APIs with Power BI? (Part 1) - Data with Dom

         

        Here's a simplified example of how you might update a parameter for a client's database name:

        ```json
        POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/Default.UpdateParameters
        
        {
        "updateDetails": [
        {
        "name": "ClientDatabaseName",
        "newValue": "Client_DB_Name"
        }
        ]
        }
        ```

        Remember to replace `{datasetId}` with the actual ID of your dataset and `Client_DB_Name` with the database name of the client you want to display data for.

         

        Best Regards,

        Neeko Tang

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