Forum Discussion

ldwf's avatar
ldwf
Icon for Helper V rankHelper V
10 months ago
Solved

Alerts with attachments - Use Power BI with Power Automate or Power BI with Power Automate

I need to build a process that runs daily that would send out an alert email and contain an Excel attachment of the detail records that meet the criteria for the alert, like all invoices past due 10 ...
  • mh2587's avatar
    10 months ago
    • Use Power Automate for scheduling and sending emails — it’s purpose-built for automation and integrates well with both Power BI and SQL Server.
    • If your data resides in SQL Server or another database, build a stored procedure or query that returns the alert dataset (e.g., invoices past due 10 days).
    • Use Power Automate to run this query daily using the “SQL Server – Get rows” or “Execute a SQL query” action.
    • Convert the result to an Excel file using the “Create CSV table” → “Create file” → “Convert to Excel” (optional) steps.
    • Attach the generated Excel file to an Outlook “Send an email (V2)” action.
    • If your data is already modeled in Power BI, you can use a Power BI dataset as the data source, but exporting detailed records from Power BI into Excel is less flexible than querying SQL directly.
    • Report Builder (SSRS) can schedule subscriptions and send reports as attachments, but it requires SQL Server Reporting Services configured with email delivery permissions — less flexible than Power Automate for dynamic logic or cloud-based alerts.
    • Recommended setup: SQL query + Power Automate flow (daily trigger) + email with Excel attachment.
    • Optional enhancement: include threshold logic in Power Automate (e.g., only send the email if records exist that meet the alert condition).