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

How we can pass dax function username() to sql query query to fetch data only for logged in user?

How we can pass dax function username or userprinciple name to sql query to retrive data for power BI report. We don't want to load all data then apply filter. only load data only for logged in user name. 

Using procedure 

 

RetriveDataForLoggedInUser(@StartDate,@EndDate, @LoggedInUserName)

 

Please suggest?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How we can pass dax function username() to sql query query to fetch data only for logged in user

Hi @arunkumar112,

 

Currently, we cannot pass the DAX function Username to sql query. As Username is not a supported function in Power Query. Here is a blog listing four ways to get USERNAME in Power Query

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Super User
Super User

Re: How we can pass dax function username() to sql query query to fetch data only for logged in user

Check out and vote for this Idea: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13926666-provide-username-functio...

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Community Support Team
Community Support Team

Re: How we can pass dax function username() to sql query query to fetch data only for logged in user

Hi @arunkumar112,

 

Currently, we cannot pass the DAX function Username to sql query. As Username is not a supported function in Power Query. Here is a blog listing four ways to get USERNAME in Power Query

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.