How to build Dynamics 365 Sales dashboards in Metabase
Microsoft Dynamics 365 Sales stores your leads, opportunities, and activities in Dataverse. Metabase is where you turn that pipeline activity into shared, trustworthy sales dashboards. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live data with a Dynamics 365 MCP server and loads a CSV into Metabase with the Metabase CLI for quick analysis, and a durable pipeline route that lands Dataverse in a database so you can build pipeline, win-rate, and forecast dashboards anyone can read.
How do you connect Dynamics 365 Sales to Metabase?
Most teams combine both routes: use the Dynamics 365 MCP server and Metabase CLI route to pull live data and stand up a quick analysis, and the pipeline route for the sales dashboards the team depends on.
Live data in, quick analysis out
Connect Dynamics 365 Sales through a managed MCP server (Pipedream) to read live opportunities, accounts, and activities, then pair it with the Metabase CLI, whose upload command loads a CSV into Metabase as a ready-to-query table and model.
- Quick lookups like "which opportunities are past their estimated close date?"
- Loading a Dynamics 365 CSV export into Metabase in seconds
- Spot-checks and one-off analyses without a warehouse
- Great for exploration, not governed reporting
- Scope the Dynamics MCP connection to read-only where possible
- CSV uploads are snapshots — refresh or move to the pipeline for history
Durable dashboards with history
Land Dataverse data in a database or warehouse with Synapse Link / Fabric, a managed connector, or the Dataverse SQL (TDS) endpoint, then point Metabase at it.
- Pipeline, win-rate, and forecast dashboards the whole team relies on
- Sales cycle and stage-conversion trends over quarters
- Joining CRM data with product usage, billing, or support data
- Requires a destination store and a sync to maintain
- You own the stage and win definitions and the refresh schedule
- Capture opportunity stage changes if you want accurate velocity metrics
What can you analyze from Dynamics 365 Sales data in Metabase?
- Pipeline — open value by stage, owner, and business unit, plus coverage against target
- Win rate — opportunities won vs. closed, by process, source, and stage
- Sales cycle length — created to won, with median and p90
- Stage conversion — where opportunities advance and where they stall
- Forecast — weighted vs. unweighted pipeline for the period
- Deal size — average and median value, plus mix by segment
- Activity — calls, emails, and appointments by rep and account
Which Dynamics 365 Sales dashboards should you build in Metabase?
Pipeline
The open book of business, right now.
- Open opportunities by stage (funnel)
- Pipeline value by owner and business unit (bar)
- Coverage vs. target for the period (number)
- Opportunities past estimated close date (table)
Conversion
Where opportunities advance and where they stall.
- Stage-to-stage conversion (funnel)
- Win rate by process and lead source (bar)
- Opportunities created vs. won by week (dual line)
- Loss-reason breakdown (bar)
Forecast & velocity
How fast deals move and close.
- Weighted vs. unweighted pipeline (bar)
- Median sales cycle length (number + trend)
- Time-in-stage by stage (bar)
- Aging of open opportunities (table)
Sales activity
Effort and coverage, not surveillance.
- Phone calls, emails, and appointments by rep (bar)
- Activities per open opportunity (number)
- Overdue activities (number)
- First-response time on new leads (line)
How do you use the Dynamics 365 MCP server with the Metabase CLI?
Connect Dynamics 365 Sales through a managed MCP server (Pipedream) and pair it with the Metabase CLI for fast, hands-on analysis. The Dynamics MCP looks up current opportunities, accounts, and activities; the Metabase CLI's upload command loads a CSV into Metabase and creates a ready-to-query table and model. Scope the connection to read-only where possible.
Example workflow
- Ask the Dynamics MCP which opportunities are past their estimated close date, or an account's open opportunities and recent activity.
- Export the opportunities or pipeline view you want to keep as a CSV.
- Run
mb upload csvto load it into Metabase as a table and model, then build questions and dashboards on top.
Be honest about the limits
- The Dynamics MCP is great for live lookups — not for scheduled or audited pipeline reporting.
- A CSV upload is a point-in-time snapshot; refresh it with
mb upload replaceor move to the pipeline for real history. - Scope the managed connection to read-only where possible; it acts with the connected account's Dataverse security roles.
mb upload csvneeds an uploads database configured under Admin → Settings → Uploads.
How do you set up the Dynamics 365 MCP server and the Metabase CLI?
Dynamics 365 MCPmanaged
- Provider
- Pipedream (managed connector)
- Endpoint
https://mcp.pipedream.net/v2- Auth
- Connect Dynamics in Pipedream (OAuth)
- Note
- Scope the connection to read-only where possible
Metabase CLIofficial
- Install
npm install -g @metabase/cli- Auth
mb auth login(browser OAuth on v62+, or an API key)- Load data
mb upload csv --file data.csv- Requires
- An uploads database (Admin → Settings → Uploads)
{
"mcpServers": {
"dynamics-365-sales": {
"url": "https://mcp.pipedream.net/v2"
}
}
}# Install the Metabase CLI
npm install -g @metabase/cli
# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com
# Load a Dynamics 365 CSV export — creates a table AND a model
mb upload csv --file dynamics-opportunities.csv --collection root
# Refresh that same table later from a new export
mb upload replace <table-id> --file dynamics-opportunities.csvConnect your Dynamics 365 Sales account in Pipedream, then use its static MCP URL. Because a third party brokers access, scope the connection tightly and review what the connector can read and write. The Metabase CLI stores its credentials securely after mb auth login.
Can you generate a Dynamics 365 dashboard with AI?
Yes. Use the prompt below with any assistant that can run the Dynamics 365 MCP server and the Metabase CLI. It works end to end: if Dynamics tables already exist in Metabase it analyzes those; otherwise it pulls the data over the Dynamics MCP, loads it with mb upload csv, then builds the dashboard — fixing the win-rate denominator and skipping metrics the data can't support instead of faking them.
Create a polished Metabase dashboard for Microsoft Dynamics 365 Sales analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.
Goal: Help sales leaders understand pipeline, win rate, conversion, sales cycle,
forecast, and rep activity from Dynamics 365 Sales (Dataverse) data.
Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for Dynamics 365 /
Dataverse tables and models). If durable data is already present — landed via
Synapse Link / Fabric or uploaded earlier — use it and skip to Step 2.
- If nothing is there, pull it with the Dynamics 365 MCP server (scope the
connection to read-only where possible): opportunities, accounts, contacts,
and activities. Write each result to a CSV, then load it with the Metabase CLI —
run "mb upload csv --file <export>.csv" so each upload creates a table and a
ready-to-query model. Use "mb upload replace <table-id> --file <export>.csv" to
refresh an existing table instead of creating duplicates.
Step 2 — Inspect before querying:
Dynamics 365 CSV exports are usually flat and pre-aggregated (one row per
opportunity, with columns like stage, estimated value, and close date), while
warehouse tables land raw Dataverse rows with option-set codes and separate stage
history. Inspect the actual tables and column names first; do not assume exact
names or that a stage-history table exists.
Important:
- Build on whatever data is present; don't claim Metabase connects natively to
Dynamics 365 — it reads a database or CLI-uploaded tables.
- Define "won" and "closed" once (opportunity statecode = Won vs. Won/Lost) and
reuse them.
- For win rate, state the denominator explicitly (won / closed vs. won / created)
and hold the cohort fixed.
- Report sales cycle length and deal size as medians (p50) and p90, never plain
averages — both are right-skewed.
- Only compute sales cycle length, time-in-stage, or stage conversion when
opportunity stage-change history exists; otherwise use a caveat.
- Dataverse money fields may carry multiple transaction currencies — convert all
amounts to a single reporting currency; caveat any mix.
- Only build a card if its underlying column/metric exists in the data.
- A single CSV is a point-in-time snapshot: only build trend cards if there is a
usable date column or multiple periods have been uploaded.
Dashboard title: Dynamics 365 Sales Overview
Sections:
1. Executive summary (KPI cards): Open pipeline; Coverage vs. target; Win rate
(last 90 days); Median sales cycle length; Average and median deal size;
Opportunities closing this period.
2. Pipeline: Open opportunities by stage; value by owner and business unit;
opportunities past close date.
3. Conversion: Stage-to-stage conversion; win rate by process and source; loss
reasons.
4. Forecast & velocity: Weighted vs. unweighted pipeline; median cycle length;
time-in-stage; aging.
5. Activity: Calls/emails/appointments by rep; activities per opportunity;
overdue activities.
Filters: Business Process, Stage, Owner, Lead source, Date range.
Reuse the models Metabase auto-created from uploaded CSVs, or (for a warehouse)
create reusable models: modeled_d365_opportunities, modeled_d365_stage_history,
modeled_d365_accounts, modeled_d365_contacts, and modeled_d365_activities.
Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data. Reconcile totals against
Dynamics 365 Sales' own reports. Keep it practical, dense, and
executive-readable. Avoid vanity metrics.How do you land Dynamics 365 (Dataverse) data in a database or warehouse?
For dashboards that need history and reliability, land Dataverse data in a database first, then connect Metabase to that database.
Connector options
- Synapse Link / Microsoft Fabric — Microsoft's first-party path to continuously export Dataverse tables to a data lake or Fabric, which Metabase can then read.
- Dataverse SQL (TDS) endpoint — a read-only SQL endpoint that SQL Server-compatible tools can query; Metabase's SQL Server driver can connect for live, read-only access.
- Fivetran / Airbyte (managed ETL) — connectors that land Dataverse / Dynamics tables in your warehouse on a schedule.
- Dataverse Web API (raw) — the source of truth for a custom pipeline.
Notes
- Land raw tables first, then build clean models on top.
- Capture opportunity stage changes (audit history or Business Process Flow stage records) for cycle length, time-in-stage, and conversion.
- Dataverse uses option sets — resolve
statecode,statuscode, and stage codes to labels in a model. - Money fields can span transaction currencies; store both raw and a converted reporting amount.
How should you model Dynamics 365 data in Metabase?
Core tables
| Dataverse table | Grain | Key columns |
|---|---|---|
opportunity | one row per opportunity | opportunityid, statecode, statuscode, stepname/stage, estimatedvalue, actualvalue, transactioncurrencyid, createdon, actualclosedate, ownerid |
| process stage / audit | one row per change | opportunityid, stage, changed_on |
account | one row per account | accountid, name, industrycode, ownerid |
contact | one row per contact | contactid, parentcustomerid, createdon |
lead | one row per lead | leadid, leadsourcecode, statecode, createdon |
activitypointer | one row per activity | activityid, activitytypecode, regardingobjectid, scheduledend, ownerid |
Modeling advice
- Build a
modeled_d365_opportunitiestable with resolvedstate_code,stage_name,est_value(one currency), andactual_close_date. - Derive
modeled_d365_stage_historyfrom audit history or Business Process Flow stage records for time-in-stage and cycle length. - Resolve option sets (statecode, statuscode, stage) to labels once.
- Convert money fields to one reporting currency using the exchange rate on the record.
- Reconcile modeled pipeline and win rate against Dynamics 365 reports before anyone trusts the numbers.
Which Dynamics 365 Sales metrics should you track in Metabase?
| Metric | Definition | Notes |
|---|---|---|
| Open pipeline | Sum of est. value for open opportunities. | Segment by stage, owner, business unit. |
| Win rate | Won ÷ closed opportunities in a cohort. | Fix the denominator (closed vs. created) before comparing. |
| Sales cycle length | Created → won, in days. | Report median and p90; it's right-skewed. |
| Stage conversion | Opportunities reaching stage N+1 ÷ reaching stage N. | Needs stage history. |
| Weighted pipeline | Σ(value × stage probability). | Use for forecast; show unweighted too. |
| Average deal size | Won value ÷ won opportunities. | Report the median too; outliers distort the mean. |
What SQL powers Dynamics 365 dashboards in Metabase?
These assume the modeled tables above (PostgreSQL dialect). Adjust identifiers to match your warehouse — the Dataverse TDS endpoint uses T-SQL.
Won as a share of closed opportunities over the last 12 months.
SELECT
date_trunc('month', o.actual_close_date) AS month,
COUNT(*) FILTER (WHERE o.state_code = 'Won') AS won,
COUNT(*) FILTER (WHERE o.state_code IN ('Won', 'Lost')) AS closed,
ROUND(
100.0 * COUNT(*) FILTER (WHERE o.state_code = 'Won')
/ NULLIF(COUNT(*) FILTER (WHERE o.state_code IN ('Won', 'Lost')), 0),
1
) AS win_rate_pct
FROM modeled_d365_opportunities o
WHERE o.state_code IN ('Won', 'Lost')
AND o.actual_close_date >= CURRENT_DATE - INTERVAL '12 months'
GROUP BY 1
ORDER BY 1;The current funnel — open opportunities and value by stage.
SELECT
o.stage_name,
COUNT(*) AS open_opportunities,
ROUND(SUM(o.est_value), 2) AS open_value
FROM modeled_d365_opportunities o
WHERE o.state_code = 'Open'
GROUP BY o.stage_name
ORDER BY open_value DESC;Days from created to won; medians beat averages here.
-- Median days from created to won, by month closed
SELECT
date_trunc('month', o.actual_close_date) AS month,
percentile_cont(0.5) WITHIN GROUP (
ORDER BY EXTRACT(EPOCH FROM (o.actual_close_date - o.created_on)) / 86400.0
) AS median_cycle_days,
percentile_cont(0.9) WITHIN GROUP (
ORDER BY EXTRACT(EPOCH FROM (o.actual_close_date - o.created_on)) / 86400.0
) AS p90_cycle_days
FROM modeled_d365_opportunities o
WHERE o.state_code = 'Won'
GROUP BY 1
ORDER BY 1;