Please wait, loading...

 

Get Data using SQL Server Connection of Microsoft dynamics 365 CDS online within Power BI and embedding in dynamics 365

June 6, 2020

In This Post, we will Get Data in Power Bi using DataQuery on SQL Server Connection with Microsoft Dynamics 365 CRM

In the previous post, we enabled TDS Endpoint using a utility  Microsoft.Crm.SE.OrgDBOrgSettingsTool .  But now we have an option to enable the TDS endpoint from http://admin.powerplatform.microsoft.com/ .

  • Navigate to http://admin.powerplatform.microsoft.com/ -> Select Environment -> In Features, we will find en checkbox for enabling the TDS endpoint. That will make a connection to the SQL server possible.
  • Also, enable Power Bi Visualization embedding
  • Verify that your environment has at least version 9.1.0.17437.
https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5edb5a87d2a96.png?fit=1638%2C829&ssl=1

Check1: Connect to SQL Server database in Power Bi

Once Prerequisites are completed we are ready to Get data using SQL Server

  • Click on Get Data -> select SQL Server and enter Details
    i.e ORGNAME.crm.dynamics.com,5558 (replace CRM as regions ) , Optional Database (ORGNAME)
  • Select DirectQuery as an option and Click OK
https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5edb5f5ba4c68.png?fit=1919%2C813&ssl=1
  • Now we will do authentication using Microsoft account and connect
https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5edb60a56f29a.png?fit=1709%2C807&ssl=1

Check2: Slect Entities and check Model for relationship testing

  • After Successful connection, let us select some entities and select load

  • I would be selecting Account and Contact and Load

  • previously when we use to get data using Odata, we needed to transform data instead of load, we can still transform data but it has reduced a lot of work after getting entities we will see that next
https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5edb617d639ff.png?fit=1099%2C874&ssl=1

Once the connection is created, In the model we will see relationship connection pre-created. we don’t have to do much work regarding relationships.

As previously we use to create relationship again in Power BI.

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5edb62230a517.png?fit=1509%2C676&ssl=1

Check3: Create a Report in Power Bi with SQL Server Connection and Embed the Power BI report as Dashboard in Dynamis 365

One of the best parts which we check above is Relationships are correctly shown as it is in CDS

  • 2nd is adding lookup, Options field, regarding field all will give Name /Label and values both as separate Fields, for which we need to do some extra work when getting data from Odata.
  • Below I have selected Lookup and Options fields as Name and ID
https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5edb6726ab9cd.png?fit=1832%2C784&ssl=1
https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more