cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
qifzhou Frequent Visitor
Frequent Visitor

Can Power BI check filters by default according to users' identity who log on ?

Hi team,

I wonder if Power BI can satisfy the following scenario :

The reports checks different filter based on user identity by default.
ie: there is a filter related to managers' name, I want to make the dashboard check manager1 filter by default when manager1 log on, and check manager2 filter by default when manager2 log on.

 

And I have tried the username() measure in Power BI, username() returns users' identity when he\she logs on,. However, username() is a mearure, it seems “CUSTOMDATA and USERNAME functions are not supported in calculated columns”. Which means I can not use IF( [someColumn] == [usrername] ) , does this measure help in this scenario ?

 

So, is it possible fo Power BI to realize it? And how ?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft New Contributor
New Contributor

Re: Can Power BI check filters by default according to users' identity who log on ?

Hi qifzhou,

 

If you mean to have Power BI using username() function as filter and also all users could access the all the data from the source, this is not currently available.

 

To have username() function works in Power BI service, we need to enable Role Level Security, otherwise, it will only display an GUID. And enable Role Level Security will only show limited data.

Check the explanation in the article below:

Using Username() in DAX with Row-Level Security

Within Power BI Desktop, username() will return a user in the format of DOMAIN\User

Within the Power BI service, username() will return the user's User Principal Name (UPN). This looks similar to an email address

See: Row-level security (RLS) with Power BI

If we would like to have all the data available with all the users, we may consider store the data file in OneDrive for Business, or SharePoint online, and only using Power BI for Reports sharing.

Regards

 

4 REPLIES 4
ankitpatira Super Contributor
Super Contributor

Re: Can Power BI check filters by default according to users' identity who log on ?

@qifzhou Can you try row level security to achieve this. So create a role then use username() function in it to identify logged in person and write DAX query to filter. Obviously that means your data has filtering has to be done via rows and since I don't know your data structure I can only think of this approach to try.

qifzhou Frequent Visitor
Frequent Visitor

Re: Can Power BI check filters by default according to users' identity who log on ?

thank you for your information @ankitpatira.

The point here is  I want to keep user possible to see all data. Using row level security, I can achieve filtering data based on user’s identity but user won’t be able to change the filter and see all data.

v-micsh-msft New Contributor
New Contributor

Re: Can Power BI check filters by default according to users' identity who log on ?

Hi qifzhou,

 

If you mean to have Power BI using username() function as filter and also all users could access the all the data from the source, this is not currently available.

 

To have username() function works in Power BI service, we need to enable Role Level Security, otherwise, it will only display an GUID. And enable Role Level Security will only show limited data.

Check the explanation in the article below:

Using Username() in DAX with Row-Level Security

Within Power BI Desktop, username() will return a user in the format of DOMAIN\User

Within the Power BI service, username() will return the user's User Principal Name (UPN). This looks similar to an email address

See: Row-level security (RLS) with Power BI

If we would like to have all the data available with all the users, we may consider store the data file in OneDrive for Business, or SharePoint online, and only using Power BI for Reports sharing.

Regards

 

qifzhou Frequent Visitor
Frequent Visitor

Re: Can Power BI check filters by default according to users' identity who log on ?

thank you for your information, Micheal_Shao. And I think I will follow your advice and try RLS.

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 240 members 2,820 guests
Please welcome our newest community members: