Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
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 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.
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.
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
thank you for your information, Micheal_Shao. And I think I will follow your advice and try RLS.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.