Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Passing username a parameter to Query

As of now we are loading all the Records from SQL Server and apply Row Level Security at PowerBI level to implement Data masking. We are seeing performance issues to load all the user Records . Can any one provide details of passing username as a parameter to SQL Query to fetch only the respective user Records. 

 

I understand that there is no option to pass Dax Function UserPrincipalname() / username() to SQL query from the Power Query editor. 

 

3 Replies

    • ImkeF's avatar
      ImkeF
      Icon for Community Champion rankCommunity Champion

      Hi Anonymous ,
      there is no native function to get the usernam in Power Query.
      And using the SQL-Current_user function would only fetch the service account under which the dataset is refreshed.