Forum Discussion
Power bi direct query with windows authentication, how to setup
Hi sekic,
From your description, it seems that you want to let each user access the report can only see his own data, right?
In your scenario, you can utilize the RLS feature. Assume there is a column contains user's User Principal Name (UPN), you can create a RLS role in Power BI desktop user's [email] = username( ). After publish the report to service, add members under this role. For more information, see: Row-level security (RLS) with Power BI.
By the way, as the .pbix file get data from the SQL server database in DirectQuery mode, after publish to the Power BI service, it requires the data gateway to build connection. See: Manage your data source - SQL Server.
Best Regards,
Qiuyun Yu
Thanks, this is fine and usable.
But can I do one more step forward; to get win user/pass thru DAX or env.variables, and connect to sql with this?
- v-qiuyu-msft9 years ago
Community Support
Hi sekic,
Sure. We can get data from SQL Server data source, and define RLS role use USERNAME() function mentioned above to limit each user access the report can only see his own data.
Best Regards,
Qiuyun Yu- sekic9 years ago
Helper I
Ok, direct query use live connection to sql database, and each action (click, filter, etc...) on dasboard is visible in SQL profiler as query on database, but I can't use Trusted_Connection=true in connection string or anything similar?
I have zilions of views on MS SQL, each of them filter records using current database user information (Microsoft Dynamics CRM filtered views), but you say that I must make copies of all of them using crossjoin with sysusers table or similar, and then separate records with RLS rule on Power BI side?
And that I must rewrite all CRM security code in filtered views to surpass Power BI RLS?
And all three products (Dynamics CRM and Power BI and SQL server) are Microsoft's but you can't solve using windows authentification in Power BI?
- Anonymous8 years agoNot applicable
Any news with updated version on this old subejct ?