How to generate Power BI report based on logged-in user in Dynamics 365 CRM Online (restricted to his own record)

By | June 14, 2019

Note – Data in report will not follow security roles of logged-in user.

Introduction

In this blog we will see how to generate Power BI report based on logged-in user in Dynamics 365 CRM Online.

Step 1

Create a report in Power BI desktop.

Power BI

Step 2

Create a role in Power BI desktop.

Go to modelling -> manage roles -> Create new role here.

Power BI

Notes:

While creating DAX expression-

  • Create condition like above
  • [domainname]-This contains email id of user
  • Userprincipalname ()-returns logged-in user email id
  • We are comparing with email id because Power BI returns users email id only

Difference between Username () and Userprincipalname ()-

Username () return user in domain/user format – (Logged-in user on system).

Power BI

Userprincipalname () return user in user (email id) format.

Step 3

After creating a role apply that role.

Go to modelling -> view as role -> select role which you have created.

Power BI

Step 4

Create relationship in Power BI desktop between system user’s entity and other entity which you are using while creating report.

Go to Home -> Manage relationships -> new

Create new relationship here.

Select primary keys as shown below.

Power BI

Step 5

Now publish report to Dynamics 365 CRM and pin that report on dashboard.

Go to CRM and add that dashboard:

  • Publish report from here.

Power BI

  • Select your workspace.

Power BI

  • Click on Pin Live Page to make Power BI report visible on dashboard.

Power BI

  • Give a name to your dashboard and make it live.

Power BI

  • Go to CRM and add this dashboard

Power BI

Here choose your workspace and dashboard.

Power BI

Step 6

Now go to Power BI service.

Power BI

Click on your dataset -> Security.

Power BI

Add user’s email for whom you want the Power BI dashboard to be visible in CRM.

Power BI

Step 7

After adding on dashboard share that dashboard to other users.

Power BI

Step 8

After sharing the dashboard please log in with the user credentials for which you have shared the report and add that dashboard. You can see report with user logged-in data.

Report of admin (Report Creator):

Power BI

Report of user 1:

Power BI

Report of user 2:

Power BI

Conclusion

We are able to see Power BI reports in Dynamics 365 CRM Online based on logged in user.

Inogic has always been an early adopter of latest Microsoft technologies and our talent pool of consultants and developers can assist you with setup, development, and configuration of Power BI reports for your easy to complex reporting needs. Write to us at crm@inogic.com to get started with Power BI!

 

Leave a Reply

Your email address will not be published. Required fields are marked *