Power BI Connection Guide
This guide explains how to connect Microsoft Power BI Desktop and Power BI Service to ECOSIRE's Analytics API, enabling you to build custom dashboards on top of your live ERP data.
Introduction
ECOSIRE exposes analytics endpoints that return structured JSON data suitable for Power BI's Web connector. You can import revenue time-series, sales pipeline, inventory KPIs, HR metrics, and customer data directly into Power BI models.
Connection methods covered:
- Power Query Web connector (recommended for live refresh)
- Excel + Power Query (for ad-hoc analysis)
- ECOSIRE Power BI Template File (fastest setup)
Prerequisites
- Microsoft Power BI Desktop (free, download here)
- ECOSIRE account with Analytics module access
- ECOSIRE API key (Dashboard → API Keys)
- Power BI Pro license (for scheduled refresh and sharing)
Step 1 — Get Your API Key
Generate a read-only API key for Power BI:
- Go to ecosire.com/dashboard/api-keys.
- Click Generate new key → set name to
Power BI→ set permission toread. - Copy the key. You will paste it into Power Query as a parameter.
Step 2 — Connect via Power Query Web Connector
- Open Power BI Desktop.
- Click Get Data → Web.
- Select Advanced and enter:
URL parts:
https://api.ecosire.com/api/analytics/revenue?from=2026-01-01&to=2026-03-31&groupBy=month
HTTP request header parameters:
Authorization | Bearer eco_live_YOUR_KEY_HERE
- Click OK. Power BI fetches the JSON and shows the query editor.
Step 3 — Parse the Response
In the Power Query editor:
- Click Convert → Into Table on the
datacolumn. - Expand the
timeSerieslist: click the expand icon → select all fields. - Rename columns as needed:
period,revenue,orders,refunds. - Set data types:
period→ Text,revenue/orders→ Whole Number. - Click Close & Apply.
Step 4 — Create Parameterized Queries
To make date ranges dynamic, create Parameters:
-
Home → Manage Parameters → New Parameter:
- Name:
DateFrom| Type: Text | Default:2026-01-01 - Name:
DateTo| Type: Text | Default:2026-03-31
- Name:
-
In the Advanced Editor, reference the parameter:
let
Source = Json.Document(
Web.Contents(
"https://api.ecosire.com/api/analytics/revenue",
[
Query = [from = DateFrom, to = DateTo, groupBy = "month"],
Headers = [Authorization = "Bearer eco_live_YOUR_KEY"]
]
)
),
timeSeries = Source[timeSeries],
toTable = Table.FromList(timeSeries, Splitter.SplitByNothing()),
expanded = Table.ExpandRecordColumn(toTable, "Column1", {"period", "revenue", "orders"})
in
expanded
Step 5 — Import Multiple Endpoints
Create separate queries for each data domain:
| Query Name | ECOSIRE Endpoint |
|---|---|
Revenue | /api/analytics/revenue |
SalesPipeline | /api/analytics/sales |
Customers | /api/analytics/customers |
Inventory | /api/inventory/products |
SupportStats | /api/helpdesk/stats |
Repeat Steps 2–4 for each endpoint. Each becomes a table in your Power BI data model.
Step 6 — Build Relationships
In Model view, connect the tables:
Revenue[period]→SalesPipeline[period](many-to-one, shared date dimension)- Create a Date Table using DAX:
DateTable = CALENDAR(DATE(2026,1,1), DATE(2026,12,31))
Step 7 — Schedule Automatic Refresh
- Publish your report to Power BI Service (File → Publish → My Workspace).
- In Power BI Service, go to your dataset → Settings → Scheduled Refresh.
- Add the ECOSIRE API key as a Data source credential:
- Authentication method: Anonymous (the key is in the query header)
- Set refresh frequency: hourly, daily, or as needed.
For real-time dashboards, use the Streaming dataset API or Direct Query mode (see Analytics API).
Step 8 — Use the ECOSIRE Power BI Template
Download the pre-built template from your dashboard:
- Go to Dashboard → Downloads → Power BI Template.
- Open
ECOSIRE_Dashboard_Template.pbitin Power BI Desktop. - When prompted, enter your API key and date range.
- All 8 dashboard pages load automatically.
Troubleshooting
| Issue | Solution |
|---|---|
403 Forbidden | API key does not have read access to the analytics endpoint |
| Empty data returned | Verify the from/to date range has data |
| Refresh fails in Service | Re-enter credentials in Power BI Service dataset settings |
| Slow query performance | Reduce date range; use groupBy=month instead of day |
| JSON parse error | Confirm the endpoint returns 200 — check for typos in URL |
Next Steps
- Analytics API — Full analytics endpoint reference
- Custom CRM Sync — Build your own data pipeline
- ECOSIRE Power BI Services — Managed BI implementation