Forum Discussion

Justas4478's avatar
Justas4478
Icon for Post Prodigy rankPost Prodigy
5 months ago
Solved

Automate table extract from report & upload file to share point

Hi, I have this matrix visual table in my report that needs to be extracted every day. Report is published in power bi service and after extract excel file would be placed in dedicated documen...
  • andrewsommer's avatar
    5 months ago

    Your best bet is to use Power Automate to query the dataset and then save the output in SharePoint. 

    1. Create Scheduled Flow

    • In Power Automate
    • Use “Recurrence” trigger
      • Frequency: Daily
      • Time: your desired refresh time

     

    1. Query Power BI Dataset

    Use the Power BI connector:

    • Action: “Run a query against a dataset”
    • Workspace: your workspace
    • Dataset: your semantic model
    • Look out for:
      • Always return a flat table (no nested structures)
    • Avoid very large result sets (API limits ~100k rows per call depending on payload size)
      • Use measures vs raw columns when possible (performance + consistency)

     

    1. Parse and Shape Output

    The output comes back as JSON.

    Add:

    • “Parse JSON” action
    • Use sample output from prior run to generate schema

    Then:

    • “Create CSV table” (simplest)
      • Input: body('Parse_JSON')?['results'][0]['tables'][0]['rows']

     

    1. Save to SharePoint

    Use SharePoint connector:

    • Action: “Create file”
      • Site Address: your SharePoint site
      • Folder Path: document library location
      • File Name:

    dataset_export_@{formatDateTime(utcNow(),'yyyy-MM-dd')}.csv

      • File Content: output of Create CSV table