title: How we can pass logged in user name to fetch data from database in PowerBI?
body: <p>I need to show data only for logged in user in PowerBI. He is manager and in drop down i want to show list of employees under him. Also, only load for all employee whose manager is logged in user</p>
  
  <p>We have more than 1 million rows for a day, so I want to hit database only for logged in username, Also, date parameter will be used from UI.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>let
      Source = Sql.Database("10.3.13.217", "TimeQSupport", [Query="DECLARE @StartDate date, @EndDate date,@UserName varchar(255);#(lf)SET @StartDate='" &amp;DateBegin&amp; "';#(lf)SET @EndDate='" &amp;DateEnd&amp; "';#(lf)SET @UserName='Gurminder'#(lf)execute usp_getTimeQeyDataPowerBI @StartDate=@StartDate, @EndDate=@EndDate, @UserName=@UserName#(lf)#(lf)"])
  in
      Source</code></pre>
  </div>
  </div>
  </p>
  
  <p>Screen shot of powerBI views.</p>
  
  <p><a href="https://i.stack.imgur.com/TOMcp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TOMcp.png" alt="enter image description here"></a></p>