Forum Discussion

vijaycherukuri's avatar
vijaycherukuri
New Member
11 hours ago

Power bi to Angular Embedded rports

Hi Team,

I need some guidance on a Power BI Embedded development requirement.

We have a project that uses Power BI Embedded with Angular. I have created a self-service BI solution where users can create and save their own reports using data from a Snowflake data source.

The business has a new requirement. In addition to the existing Snowflake data model, users should be able to upload their own Excel or CSV files through an upload option provided in the Angular application (via API). The uploaded file should be treated as an external data source, allowing users to analyze the data and build reports within the same Power BI Embedded environment.

Our main question is:

How can Power BI automatically add the uploaded Excel/CSV data as an additional table or dataset to the existing Power BI dataset/model? Is there a recommended approach or architecture for handling this scenario in Power BI Embedded?

If anyone has experience with a similar implementation, please share your suggestions, best practices, or any relevant documentation.

Thanks in advance for your help.

1 Reply

  • jubinsoni's avatar
    jubinsoni
    Icon for Skilled Sharer rankSkilled Sharer

    Hi vijaycherukuri​,

    Power BI won't pick up an uploaded file and add it to a model on its own. Your backend has to land the file somewhere, then change or create a model and include it in the embed token. The key design choice is to avoid modifying the shared Snowflake model per user. Every user's upload would end up in everyone's model, and a schema change there needs a full model update.

    A pattern that scales better is to keep the Snowflake model untouched and give each upload its own small model:

    Angular upload -> your API (validate size/schema, sanitize column names)
      -> write file to OneLake: lakehouse Files/uploads/{tenantOrUser}/{fileId}.csv
      -> run notebook on demand: CSV/Excel -> Delta table upload_{fileId}
      -> semantic model for the upload (template model cloned via XMLA/TOM, or Direct Lake on that table)
      -> embed token covering BOTH datasets -> user builds report in the embedded editor

    Kicking off the load notebook from your API is one REST call, with the file passed as a parameter:

    POST https://api.fabric.microsoft.com/v1/workspaces/{wsId}/items/{notebookId}/jobs/instances?jobType=RunNotebook
    {
      "executionData": {
        "parameters": {
          "file_path": { "value": "Files/uploads/u123/f456.csv", "type": "string" },
          "table_name": { "value": "upload_f456", "type": "string" }
        }
      }
    }

    Then generate a multi-resource embed token so the editor can see both models and save into the user's workspace:

    POST https://api.powerbi.com/v1.0/myorg/GenerateToken
    {
      "datasets": [ { "id": "<snowflakeDatasetId>" }, { "id": "<uploadDatasetId>" } ],
      "reports":  [ { "id": "<reportId>", "allowEdit": true } ],
      "targetWorkspaces": [ { "id": "<userWorkspaceId>" } ]
    }

    If users need to join their file to Snowflake data in one visual, build the upload model as a composite model: DirectQuery to the Snowflake semantic model plus the uploaded table, with a relationship on the shared key. That keeps the core model read-only and still allows blending.

    Also plan the lifecycle: a cleanup job for old uploads, row/size limits at the API, and RLS or a per-tenant workspace if users must not see each other's files.

    So my overall approach would be:

    Keep Snowflake model read-only (shared)
    Upload -> OneLake -> notebook job -> Delta table per upload
    Per-upload model (or composite on top of the Snowflake model for blending)
    Multi-dataset embed token -> embedded edit/save in user workspace
    Cleanup + limits + isolation per tenant/user

    AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.