Viva Insights Sample Code
Copilot Analytics
Analyze Microsoft 365 Copilot usage from Viva Insights — adoption metrics, Power User and Habitual User segmentation, and habit-based behavioral models in R, Python, and Power BI.
Copilot Analytics Scripts
This page contains specialized scripts for analyzing Microsoft Copilot usage data from Viva Insights.
Beyond covering key analyses around Copilot usage volume and breadth (range of actions and applications), these scripts also include a method for measuring Copilot habituality based on behavioral research. This approach determines whether a user can be considered a habitual Copilot user, enabling visualization through user segmentation that identifies Power Users and Habitual Users within an organization. This segmentation provides a framework for continuously tracking Copilot adoption success and measuring the effectiveness of your deployment strategy.
See our DAX Calculated Columns page for detailed instructions on how to identify Copilot Usage Segments using Power BI templates and pre-built DAX formulas.
For more information on the Copilot Usage Segments, see this introduction.
For more inspiration on analyzing Copilot adoption and impact, have a look at our advanced examples playbook.
Advanced Analysis Scripts
Copilot Advanced Analysis (R)
📄 copilot-analytics-examples.R
- Purpose: Comprehensive analysis of Copilot usage patterns and trends
- Language: R
- Prerequisites: vivainsights R package, Copilot usage data
- Key Analysis: Usage segmentation, trend analysis, adoption metrics
- 📥 Download
Copilot Advanced Analysis (Python)
📄 copilot-analytics-examples.py
- Purpose: Comprehensive analysis of Copilot usage patterns and trends
- Language: Python
- Prerequisites: vivainsights Python package, Copilot usage data
- Key Analysis: Usage segmentation, trend analysis, adoption metrics
- 📥 Download
Copilot Analytics (Jupyter Notebook)
📓 copilot-analytics-examples.ipynb
- Purpose: Interactive analysis of Copilot usage with visualizations
- Language: Python
- Format: Jupyter Notebook
- Prerequisites: vivainsights Python package, Copilot usage data
- Key Features: Step-by-step analysis, interactive visualizations
- 📥 Download
Power BI Integration
DAX Calculated Columns
- Purpose: Pre-built DAX formulas for Copilot usage segmentation in Power BI
- Language: DAX
- Format: Individual .dax files
- Prerequisites: Power BI Desktop, Copilot usage data
Available Columns:
12-Week Rolling (RL12W) - Recommended for long-term analysis
- 📄 _Total Copilot actions_RL12W.dax: Average weekly actions over 12 weeks
- 📄 _IsHabit_RL12W.dax: Habit formation indicator (9+ weeks of usage)
- 📄 _CopilotUsageSegment_RL12W.dax: User segmentation (Power/Habitual/Novice/Low/Non-users)
4-Week Rolling (RL4W) - Recommended for short-term/pilot analysis
- 📄 _Total Copilot actions_RL4W.dax: Average weekly actions over 4 weeks
- 📄 _IsHabit_RL4W.dax: Habit formation indicator (4 weeks of usage)
- 📄 _CopilotUsageSegment_RL4W.dax: User segmentation (Power/Habitual/Novice/Low/Non-users)
Usage Segmentation
User Segments Defined
These five segments form a single mutually-exclusive ladder, evaluated top-down so every user falls into exactly one tier (full definitions and decision tree on the Copilot Usage Segments page):
- Power Users: Habitual and averaging 15+ weekly Copilot actions
- Habitual Users: Habitual (9+ of 12 weeks in RL12W, all weeks in RL4W) but averaging < 15 weekly actions
- Novice Users: Not habitual, averaging 1+ weekly Copilot actions
- Low Users: Not habitual, some usage but averaging < 1 weekly action
- Non-users: No Copilot usage in the measurement period
Sample Data
Example Datasets
- 📄 copilot-metrics-taxonomy.csv: Copilot metrics reference
- 📄 viva-insights-org-data-sample.xlsx: Sample organizational data
Getting Started
- Export Copilot Usage Data from Viva Insights
- Choose Your Analysis Method:
- R/Python scripts for detailed analysis
- DAX columns for Power BI dashboards
- Select Time Frame:
- RL12W for long-term habit analysis
- RL4W for pilot programs or short-term analysis
- Run Analysis using the appropriate script
Related pages
- Copilot Usage Segments — how Power, Habitual, and Novice segments are defined
- DAX Calculated Columns — ready-to-use Power BI formulas for segmentation
- Copilot Causal Toolkit — measure the causal impact of Copilot on business outcomes
- Causal Inference in Copilot Analytics — methods for isolating Copilot’s true effect
- Frontier Prompt Library — generate Copilot reports and dashboards with coding agents
Need Help?
- Copilot Analytics Documentation: Viva Insights Copilot Guide
- Power BI Integration: DAX Documentation
- Sample Data: Example datasets