Frontier
Build with AI: Consumption Dashboard
Reproduce the Consumption demo or build a scoped credits dashboard with an AI coding agent and reusable R code.
Build with AI: Consumption and Ways of Working
← Back to Prompt Library · View dashboard examples
Purpose
Reproduce the synthetic seven-page R demo, then customise it or build a narrower credits dashboard from documented Consumption exports without starting over.
Audience
People analytics practitioners and analysts exploring Copilot consumption.
When to use
Choose this journey for the Consumption query, not the general Person Query adoption dashboard. A coding agent can follow the workflow without installing a skill; frequent users can install the optional dashboard skill.
Required inputs
- A local checkout of
microsoft/viva-insights-sample-codecontaining the shared runner atfrontier-analytics/starter-kits/copilot-query-dashboard/. - R and the dependencies listed by the runner; Pandoc for the reference demo.
- Demo: supplied synthetic fixture files only.
- Real: locally extracted activity and people-metadata CSVs, query grain, date window, mapping evidence and privacy requirements. An HR group is optional and only used when a suitable field is available and grouping is requested.
Assumptions
The demo fixtures carry synthetic values in the real Consumption schema, so the demo and a governed export describe the same fields. Tokens and delegated task types are not part of that schema and are not present in the demo; do not expect or reconstruct them.
Recommended output
A self-contained HTML report, reproducible config and source, local provenance, validation summary, and explicit supported/excluded analyses. Real data stays outside the repository and is never pasted into the prompt.
Quick prompt (short version)
Help me reproduce or customise the Consumption and Ways of Working dashboard.
Recover choices already supplied, then ask only for missing checkout, demo versus real mode, output folder and intended changes.
Read frontier-analytics/skills/viva-insights-copilot-dashboards/SKILL.md in that checkout as workflow instructions, without requiring skill installation.
Use its Consumption manifest and the shared R runner; do not regenerate the dashboard from scratch.
For real exports, inspect locally, show supported and excluded panels, and get my approval before building.
If no suitable HR group field is available, set `group=false`, omit group breakdowns, and keep supported period/service results.
Do not invent tokens, licensing, coverage, identity mappings or causal conclusions.
Use max(the organisational requirement, 10 distinct people) for all published
and embedded data, protect complementary cells and never publish individual rankings.
Read configured grouping and measurement windows, not date spacing. Within a supplied
complete query's configured scope, absent activity contributes zero. Null credit
cells, failed joins, unavailable sources, out-of-scope periods and known coverage
failures remain unresolved. Do not apply licensed-only M365 Copilot null semantics to credits.
Prompt
Build a Consumption dashboard using the local microsoft/viva-insights-sample-code checkout.
Recover any inputs I already supplied. Use prompt mode for the remaining choices:
checkout path, demo or real, audience, input files, output directory, period, grouping,
privacy threshold (at least 10 distinct people), and requested customisations.
Read frontier-analytics/skills/viva-insights-copilot-dashboards/SKILL.md and only
the selected mode plus Consumption manifest. Read the shared query contract it links.
Use frontier-analytics/starter-kits/copilot-query-dashboard/README.md for the config
schema and dashboard.R commands. Record the checkout revision and source fingerprints.
For demo mode, reproduce the reference using copied synthetic fixtures in a new output
workspace. Keep the fixed seed/window and synthetic labels. Do not alter canonical source files.
For real mode, inspect the extracted CSVs locally and return bounded schema summaries,
not rows or identifiers. Verify keys, grain, units and historical metadata joins.
Read configured grouping and measurement windows; date spacing is diagnostic only.
Apply the current join contract's zero rule only to absent activity within a supplied
complete query's configured scope. Null credit cells, failed joins, unavailable
sources, out-of-scope periods and known coverage failures remain unresolved.
Licensed-only M365 Copilot null semantics do not apply to credits. The credits-only runner reports
observed records, not an invented eligible roster or non-user panel.
Set the runner's `group` option to true only when a suitable mapped HR attribute is
available and the user wants group breakdowns. Otherwise set it to false, omit HR-group
outputs and retain supported period/service results.
Present supported/excluded panels and mapping evidence; wait for my approval to build.
Build only the supported M365 credits panels in real v1; sessions, Person Query
associations and GitHub panels require separate verified adapters. Do not generate
synthetic replacements, infer licences from activity, or sum policy limits.
Use the existing R code. Check dependencies before requesting installation. Do not read
the generated HTML or whole CSVs into model context. No individual rankings or unsupported
productivity, ROI, quality, burnout or causal claims. Apply max(the organisational
requirement, 10 distinct people) in every output, including embedded data and
complementary-cell disclosure checks.
After two unsuccessful repairs of the same failure, stop with the specific blocker.
Return the local report, rerun command, config/provenance and limitations. Do not publish.
<!-- analysis-policy:start -->
Use product-specific licence evidence. For documented native licensed-only M365 Copilot metrics, null means unlicensed and zero activity means licensed but inactive. Prefer Copilot Enabled User or Total Copilot enabled days. Do not extend these semantics to unlicensed Copilot Chat or Consumption credits.
Investigate conflicting licence evidence. Keep affected eligibility or activity unresolved, and withhold affected rates or estimates until resolved.
Within a supplied complete query's configured scope, absent activity rows contribute zero. Keep failed joins, unavailable sources, out-of-scope periods and known coverage failures unresolved with reasons.
Use configured grouping, week start and metric windows; date gaps do not establish cadence. State grain, units and estimand. Count distinct people; do not sum stocks or overlapping windows.
Use max(organisation requirement, workflow floor): 5 distinct people for general analysis and 10 for joined-query, dashboard, causal or process workflows. Protect complementary cells and embedded data; never publish individual rankings.
Use only HR attributes present in the export. If none suit a requested breakdown, omit it, explain why, and continue with supported overall results.
Treat low-activity flags as review candidates, not verified holidays, employment status or job classifications. Value scenarios require explicit conversion and realisation assumptions.
Default to association. Make causal claims only with a supported design and compatible estimators. Record unavailable checks and label synthetic data.
Check installed API versions, signatures and return types. Separate executed results from expectations and do not silently fork upstream bugs.
<!-- analysis-policy:end -->
Adaptation notes
Start with “change the colours and section order” for a presentation-only iteration. Changing dates, grouping or sources requires renewed data and privacy checks. Person Query associations require a separately verified adapter.
Common failure modes
- Assuming credit exports contain tokens: build only supported panels.
- Joining service rows directly to Person Query: aggregate to compatible person-period grain first; a joined real-data adapter is not supplied in v1.
- Rendering in the examples folder: use the isolated runner workspace.
- Calling credits money or value: retain credit units and descriptive claims.
Resources
- Joining Viva Insights queries for a separately implemented cross-query analysis. The real v1 credits-only adapter does not require a Person Query or accept the tutorial’s joined panel.
- Starter kit
- Shared runner
- Optional skill installation
- Public Consumption schema
Responsible use & data privacy
- Suppress small groups. Apply the stricter of your organisation's minimum group size and the selected workflow's privacy floor to every breakdown, segment and chart.
- Never expose individuals. Do not print raw UPNs or email addresses. Hash, truncate or report only aggregates. Person Query
PersonIdis already de-identified, but PurviewUserIdis not. - Report group patterns. Use these outputs to understand cohorts and trends. Do not evaluate, rank or monitor named employees.
- Keep data in approved environments. Follow your organisation's policies when choosing an agent and deciding which data it may access. Validate every agent output before sharing.