2

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

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.

let
    Source = Sql.Database("10.3.13.217", "TimeQSupport", [Query="DECLARE @StartDate date, @EndDate date,@UserName varchar(255);#(lf)SET @StartDate='" &DateBegin& "';#(lf)SET @EndDate='" &DateEnd& "';#(lf)SET @UserName='Gurminder'#(lf)execute usp_getTimeQeyDataPowerBI @StartDate=@StartDate, @EndDate=@EndDate, @UserName=@UserName#(lf)#(lf)"])
in
    Source

Screen shot of powerBI views.

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44
Arun Kumar
  • 21
  • 1
  • 3

1 Answers1

0

Are you viewing the report in PowerBI.com or using an embedded view of PowerBI?

From your question i assume you are using direct query, when using direct query to SQL Azure, you can get data filtered on the SQL server level using single-sign-on (as described in https://learn.microsoft.com/en-us/power-bi/service-azure-sql-database-with-direct-connect), this is only supported for SQL Azure, and only when using PowerBI.com (not PowerBI embedded).

Alternatively - you can switch to imported data (and refresh the data upto 8 times a day), this will allow you to set row-level-security on the dataset using PowerBI desktop (see https://learn.microsoft.com/en-us/power-bi/service-admin-rls)

Ran
  • 59
  • 1