Note – Data in report will not follow security roles of logged-in user.
In this blog we will see how to generate Power BI report based on logged-in user in Dynamics 365 CRM Online.
Create a report in Power BI desktop.
Create a role in Power BI desktop.
Go to modelling -> manage roles -> Create new role here.
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).
Userprincipalname () return user in user (email id) format.
After creating a role apply that role.
Go to modelling -> view as role -> select role which you have created.
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.
Now publish report to Dynamics 365 CRM and pin that report on dashboard.
Go to CRM and add that dashboard:
- Publish report from here.
- Select your workspace.
- Click on Pin Live Page to make Power BI report visible on dashboard.
- Give a name to your dashboard and make it live.
- Go to CRM and add this dashboard
Here choose your workspace and dashboard.
Now go to Power BI service.
Click on your dataset -> Security.
Add user’s email for whom you want the Power BI dashboard to be visible in CRM.
After adding on dashboard share that dashboard to other users.
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):
Report of user 1:
Report of user 2:
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 firstname.lastname@example.org to get started with Power BI!