Forum Discussion
How do i use USERNAME() dax function in my store procedure as a parameter in power bi query ?
I don't think this is supported in Power BI Service.
Is there any workaround ?
- Sunkari9 years ago
Responsive Resident
I am not sure on your approach.
But you can think of pulling all the information into Power BI and implementing RLS.
or
Creating a tabular model with RLS.
https://powerbi.microsoft.com/en-us/documentation/powerbi-admin-rls/
- Rinkesh9 years agoRegular Visitor
Hi Sunkari,
Thanks for the suggestion.
I have been already used RLS . As per my understanding, In RLS we can use USERNAME() function which returns logged in user name/email.
My challenge is that I want to pass this returned username or email in my SP parameter.- Eric_Zhang9 years ago
Microsoft Employee
Rinkesh wrote:
Hi Sunkari,
Thanks for the suggestion.
I have been already used RLS . As per my understanding, In RLS we can use USERNAME() function which returns logged in user name/email.
My challenge is that I want to pass this returned username or email in my SP parameter.It is not possible and there's no workaround. As you've already used RLS, you can alter the SP to retrieve data for all domain users and apply RLS to restrict those users to see their own data.