cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
arunkumar112
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
Microsoft
Microsoft

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.

View solution in original post

3 REPLIES 3
Super User IV
Super User IV

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...

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Microsoft
Microsoft

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.

View solution in original post

Anonymous
Not applicable

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

Did anyone have answers to the above questions?

Is it possible to that in latest powerBI

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors