Power BI with Dynamics 365 for Sales: Custom URL Linking and Advanced Drill-Back to CRM Records
Using advanced drill-back, Dynamics 365 for Sales and CRM users can construct a URL to access a specific forms, views or dashboards from within Power BI.
Using advanced drill-back, Dynamics 365 for Sales and CRM users can construct a URL to access a specific forms, views or dashboards from within Power BI.
Table of Content
Technology is evolving and transforming all functions of the organizational ecosystem, and it is imperative businesses execute a plan to implement systems, platforms, and analytics that are resilient and scalable. Microsoft Dynamics 365 (“D365”) Apps, including embedded intelligence and machine learning, are only a few solutions that are having a dramatic and positive impact on business’s ability to thrive in this accelerated environment. Marrying D365 apps with PowerApps, Power BI, and Flow (otherwise known as the Microsoft Power Platform), organizations can be optimistic they will stay relevant well into the future. D365 and the Microsoft Power Platform will shape the analytical landscape and advance our strategic business and operational decisions. One of the common client asks that can be achieved with the Power Platform is the ability use Power BI with Dynamics 365 for Sales to drill back to specific forms, views, or dashboards (note, these concepts can also be applied to CRM) using a URL.
Power BI is becoming the de facto reporting tool for Dynamics 365, and I have had the opportunity to be the key architect and developer on several enterprise deployments of D365 and Power Platform solutions. In the past, I programmed SQL Server Reporting Services (SSRS) to handle the more complicated features. One of these being the ability to drill into D365 or CRM records from an SSRS report. This can be very opportune for end users to easily modify or quickly take action on a record. Previously, I had accomplished this with a custom expression in the drill action of a text box.
Now, it is a quite common that I am asked whether users can construct a URL to access a specific D365 for Sales (CRM) form, view or dashboard from within Power BI reports. Learning outcomes are:
1. Uncover the concepts around accessing D365 for Sales elements using a URL
2. Extracting data entities from D365 for Sales
3. Developing a dynamic drill-back URL utilizing the transformation engine (Query Editor) that can enable business users to navigate from BI analysis to D365 for Sales
In this first article, I am going to describe the elements of the URL for linking to entity forms. I will follow this with another article covering linking to views and dashboards, and using PowerApps to perform everything read here and more.
To navigate to a view for accounts with an id of %7b61273827-328E-E011-95AE-00155D9CFA03%7d use the following:
<<Your Connection String>>/main.aspx?etn=account&pagetype=entitylist&viewid=%7b61273827-328E-E011-95AE-00155D9CFA03%7d&viewtype=1039&navbar=off&cmdbar=false
My solution uses the syntax “/main.aspx?etn=account&….”. However, when you copy a URL in D365 you may also see etc used in place of etn. So “/main.aspx?etc=1&….”. Etc is the numeric code representing an entity. Whilst this may typically work for system entities, I have encountered many issues with custom entities, as the numeric code can be different in different organizations. Therefore, it is best practice to always reference entities by name using “etn”.
We are going to begin in D365 for Sales to extract the URL elements needed to complete our drill-back and link your report in Power BI with Dynamics 365.
This can also be achieved by popping out the activity details from within D365 for Sales activities detail.
https://<<your_org>>.crm.dynamics.com/main.aspx?pagetype=entityrecord&etn=<<activitytypeid>> &id=%7b<<activityid>>%7d
The highlighted parts will need to be substituted:
Copy this into notepad and save it as we will be using it in the next section.
With the D365 for Sales URL in a notepad, navigate to Power BI and use the Query Editor to consume the OData entities available in D365.
From the Query Editor, we are going to add the drill-back column by using Power BI’s Column From Examples.
https://<<your_org>>.crm.dynamics.com/main.aspx?pagetype=entityrecord&etn=<<activitytypeid>> &id=%7b<<activityid>>%7d
“https://<<your_org>>.crm.dynamics.com/main.aspx?pagetype=entityrecord&etn=”& [activitytypecode] & “&id=%7b”& [activity]& “%7d”
After extracting and transforming data utilizing the powerful Query Editor, the final steps will be to load the Activities data to the model and begin developing the business logic.
Bonus: Additional activities which I will perform are to create dimensions within my query editor and merge them with the Activities table.
Looking incredible! Now we can save the report, and (optionally) publish to the organization for other users to view. Congratulations – an action oriented Activities report linking Power BI with Dynamics 365 for Sales with dynamic drill back to specific records is now available for proactive decision making.
Learn more about Power BI and all its features here.
Talk to us about how Velosio can help you realize business value faster with end-to-end solutions and cloud services.