Writing Power BI reports

Power BI is a cloud service from Microsoft that provides integration options for Dynamics 365 CE. Using Power BI, we can develop rich reports and share them with users. Here, we are going to develop a sample report using Power BI; so, first, we need to set up a Power BI trial at https://powerbi.microsoft.com. You can use your same Office 365 credentials to set up this trial. We will develop our report using Power BI Desktop, which you can download at https://powerbi.microsoft.com.

Let's perform the following steps to develop our sample report:

  1. Download Power BI Desktop and complete the installation steps.
  2. Open Power BI Desktop and click on Get data:

  1. Connect to Dynamics 365 CE by taking the following steps:

  1. As soon as we click on Connect, a new dialog will appear, in which we can provide a Web API URL. We can copy it from the Settings | Customization | Developer Resources section:

It may ask you to connect to your Dynamics 365 CE organization if you are using it for the first time. Use your Dynamics 365 CE credentials.

  1. Now we are connected to our Dynamics 365 CE organization, we need to select which entities we want to use in our report. Let's select the accounts, him_makes, him_models, and him_vehicles entities. Power BI Desktop will connect to Dynamics 365 CE and we should be able to see all the selected entities in the Report Designer, as follows:

  1. Let's expand the him_vehicles entity and select him_vehiclename, him_vehiclenumber, and _him_customer_value from the list. We can change the label of the fields by taking the following steps:

  1. You will notice that the customer name is not displayed; instead, it will display the GUID of the customer record. To get the customer name, we need to add a new column and use the LookupValue method, so let's do that.
  2. Click on the New Column button and change the label to Customer Name:

  1. We will use the following formula to get the display name of the customer based on their GUID:
Customer Name= LOOKUPVALUE(accounts[name],accounts[accountid],him_vehicles[_him_customer_value])

Here, the first parameter represents which column we want to get from the related entity, the second parameter is based on which column we want to get data, and the last parameter represents the GUID field of the current entity, which holds the customer ID. Now, we can uncheck the him_customer_value field and check our new Customer Name field, and we should be able to see our new field in our report, like so:

We can use other visualization controls based on our requirements.

You can find more information on creating Power BI reports at https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-report-add-visualizations-i.

  1. We can use the Format option to format different sections of the report:

Now, our sample report is ready, so let's upload it to Dynamics 365 CE.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.54.63