Configuring Custom Metrics in Dynamics 365 Customer Service
When working with Dynamics 365 Customer Service, you can do a lot with the out of box reports and analytics covering aspects such as Historical Analytics which include a Summary Report, Agent Report, Topics report amongst others.
However, organizations often have peculiar requirements which mandate configuring custom metrics or surfacing data not included in the out of the box reports. In such cases, you can use the model customization possibilities in Customer Service. How you can do this is the focus on this article.
For custom reporting requirements in Dynamics 365 Customer Service, you have 2 options:
Visually customize the out of the box reports - the reports in Customer Service contain visualized KPIs and trends for standard contact center workflows. There’s an embedded PowerBI editor which you can use to customize the out-of-the-box reports for your organization’s needs. Some needs that can be addressed with visual customization include:
Revealing out-of-the-box metrics which your organization may find more relevant
Modifying data presentation: you may prefer a different graphic for displaying certain data points
Adding new pivots and pages: you might want to show data for specific queues beyond what’s out of the box
Rearranging report layouts and changing themes
Certain limitations exist for visual customizations. While you can customize Customer Service Historical , Omnichannel historical and Omnichannel real-time analytics, you can’t customize unified routing and knowledge analytics reports
Customize the underlying model, extending it to fit your needs
Power BI’s extensibility allows you extend the out-of-the-box data model for Dynamics 365 Customer Service to include other dataset to create new custom metrics. You can add your own KPIs and custom metrics to view what’s most relevant for your organization. Key capabilities of model customization include:
Editing out of the box data model and adding new metrics
Bringing in your own custom entities from Dataverse or other data sources to extend the PowerBI data model
Publishing the customized report to specific Power BI workspaces
Customizing the report site map, enabling users to access the reports natively withing Customer Service Workspace
Let’s now look more closely at how you’d approach the customization of the the Data Model in PowerBI. First, the prerequisites:
Power BI Professional or Power BI Premium license for all supervisors and admins
Enable insights features in Dynamics 365 Customer Service:
If you are enabling historical data model customization, you must enable at least one of the historical reports, such as customer service historical analytics, Omnichannel historical analytics, or knowledge analytics. More information: Configure analytics and insights dashboards
If you are enabling real-time data model customization, you must enable real-time analytics for Omnichannel. More information: Configure analytics and insights dashboards
Create a Microsoft Azure Active Directory security group:
Your Azure Active Directory administrator must create a security group with your preferred name in the Azure Active Directory and add Dynamics 365 Analytics as a member of this security group. More information: Create a basic group and add members using Azure Active Directory
The out-of-the-box Service Principal Dynamics 365 Analytics is used to deploy the data model and make changes to the Power BI workspace on behalf of Dynamics 365 Customer Service.
Permissions within Power BI can be granted only to groups and not individual service principals, and therefore a group needs to be created.
Enable Power BI service features from the Power BI admin portal. The Power BI administrator must enable the following, either for the entire organization or the for the security group created earlier:
Create workspace (new workspace experience): Enabling this creates two workspaces, a managed workspace and a customer workspace to deploy Dynamics data model and reports.
Allow service principals to use Power BI APIs: This uses the Power BI APIs for creating workspaces, deploying reports and models.
Allow DirectQuery connections to Power BI datasets: When report authors build new metrics or bring additional data sources, they create composite models, so DirectQuery needs to be enabled. Users who view reports built on top of data model in Dynamics 365 require this permission. If you don't have the required permissions, work with your Azure Active Directory administrator to identify a security group that has all the required Dynamics users.
Allow XMLA endpoints and Analyze in Excel with on-premise datasets: When report authors build new metrics or bring additional data sources, they create composite models, so this feature needs to be enabled. Users who view reports built on top of data model in Dynamics 365 require this permission. If you don't have the required permissions, work with your Azure Active Directory administrator to identify a security group that has all the required Dynamics users.
If you plan to use an existing Power BI workspace to host the copy of the out-of-the-box reports (customer workspace), make sure that the Dynamics Administrator (user login) enabling the model customization is a workspace administrator of that Power BI workspace.
Once the prerequisites are in place, we can now proceed with actually enabling the data model customization. To do that, we need to follow these steps:
In the Customer Service admin center site map, select Insights in Operations.
On the Insights page in the Report settings section:
For historical, select Embedded Power BI extensibility - Historical data model customization and then select Manage.
For real time, select Embedded Power BI extensibility - Real-time data model customization and then select Manage.
On the selected page, switch the Enable embedded Power BI data model customization toggle to On.
Now, we can step through the following tasks to complete the configuration
Step 1: Select a Power BI workspace
Specify the Power BI workspace where the Dynamics data model and reports will be provisioned.
From the Insights page, go to the data model for which you want to select a Power BI workspace.
Select Create new workspace or to use an existing workspace, select a workspace from the dropdown list.
Select Save. This initiates the provisioning of the reports.
The specified workspace applies only to the customer's workspace. A new managed workspace will be created by Microsoft for historical and real-time reports each, when configured. For more information, go to: How data model customization works. You can also specify the same workspace for both historical and real-time analytics reports.
Step 2: Provision the data models
It could take up to 24 hours for the provisioning to complete. You can leave the Settings page and check back after a few hours. Select Refresh to check the provisioning status.
Step 3: Grant permissions for dataset and reports
After the report is provisioned, you must provide Write permissions for users who will be authoring reports in Power BI and Read permissions for supervisors and other consumers of the reports.
You'll need to be a Workspace Administrator on both managed and customer workspaces (configured on Step 1) in Power BI to complete this step. By default, the user who starts the provisioning (Step 2) will have the necessary permissions added.
Grant access to the Power BI data model
Report authors will connect to the specified data model to build custom reports. When you select the Power BI Data model link, the managed workspace opens up and the details of the data model are displayed. Use the Share dialog to provide access to users by entering their email address. More information: Share access to a dataset.
You need to:
Provide report authors with Allow recipients to build content with the data associated with this dataset access.
For report viewers like supervisors, you may choose to share the dataset without providing any additional permissions.
Grant permissions to the customized Power BI report (optional)
When you select the Customized Power BI Report link, the Power BI workspace where the sample reports will be provided appears in a lineage view. These reports are the copy of your out-of-the-box reports and can be edited and modified. You'll have to provide access to the workspace only if your organization plans on using these copies to develop reports.
From the lineage view, select Access, and provide Contributor access to your report authors and Viewer access to users who will be viewing these or any other reports built in this workspace. For more information on data permissions, go to: Manage dataset access permissions (preview). You'll have to provide these permissions only if you plan to use these reports.
Bringing the Report down into PowerBI Desktop
Next, we’d navigate to the Power BI Data Model by clicking on the link within Customer Service Admin center. This should land us in the Workspace that was created as part of provisioning the data model.
Once there, we can open the historical report and then download a copy of it with the live connection to the data model.
After the download is complete, open it with Power BI desktop
When it opens in PowerBI desktop, click on the Modelling tab, then on Make changes to this model. Doing this will open a prompt asking you to create a DirectQuery connection. Click on Add a local model which will connect to the Dynamcis 365 Customer Service Data Model in Dataverse giving you access to all the tables in Dataverse
Now, click on Home then Get Data and select Dataverse, you can now search for any tables you need to load into your model to configure your custom metric.
After selecting the tables of interest, you can now setup relationships between the tables and configure custom metrics on top of them.