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.
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
- Now we will do authentication using Microsoft account and connect
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
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.
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