<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamic SQL datasource selector in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3299240#M43213</link>
    <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;my problem is not to bind record to users, my goal is to create one single Power BI template and attach dynamically new datasources (each one is a SQL database, one for each company). So, if a new company will be created, Power BI report will recognize automatically that a new datasource is available and can show the data of new company/db.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 23 Jun 2023 06:56:36 GMT</pubDate>
    <dc:creator>mferraricloudsu</dc:creator>
    <dc:date>2023-06-23T06:56:36Z</dc:date>
    <item>
      <title>Dynamic SQL datasource selector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3295027#M43179</link>
      <description>&lt;P&gt;We have this scenario:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1 Azure App Service back-end API service (.NET 7)&lt;/LI&gt;&lt;LI&gt;1 Azure App Service front-end client App&lt;/LI&gt;&lt;LI&gt;Azure SQL Server elastic pool with hundreds of databases&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, a user login trough front-end to his own company db. Front-end calls back-end service and start to interact with his own company data.&lt;/P&gt;&lt;P&gt;What we are trying to do is to use Power BI in order to create one or more report templates and embed it inside the front-end. The goal is to have a report which dynamically retrieve data from the proper db in according to user credentials.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;user: &lt;EM&gt;MrX&lt;/EM&gt; is logged in to company with id &lt;STRONG&gt;50&lt;/STRONG&gt; (so all data are retrieved from SQL db MyDatabase_&lt;STRONG&gt;50&lt;/STRONG&gt;).&lt;/LI&gt;&lt;LI&gt;once &lt;EM&gt;MrX &lt;/EM&gt;is&amp;nbsp;logged in, have an app section that shows a Power BI report pre-filtered with data taken only from&amp;nbsp;MyDatabase_&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another important aspect: new companies will be continuously activated, so it's important that Power BI report data sources list is dynamically synced with the current companies list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does exists a way to implement this kind of architecture and which is the best approach to reach this behavior with Power BI ?&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Jun 2023 09:01:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3295027#M43179</guid>
      <dc:creator>mferraricloudsu</dc:creator>
      <dc:date>2023-06-21T09:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL datasource selector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3299225#M43212</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/97653"&gt;@mferraricloudsu&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'd like to suggest you binding users with their companies and use company field to link to other fields.&amp;nbsp;Then you can add a RLS filter on the company field based on current username to apply to users. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;After above steps and assign role to users, these records will be fileted based on current users’ company.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/RLS-with-UserName/m-p/82327" target="_blank"&gt;Solved: RLS with UserName() - Microsoft Fabric Community&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls#manage-security-on-your-model" target="_blank"&gt;Row-level security (RLS) with Power BI - Power BI | Microsoft Learn&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 06:47:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3299225#M43212</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-23T06:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL datasource selector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3299240#M43213</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;my problem is not to bind record to users, my goal is to create one single Power BI template and attach dynamically new datasources (each one is a SQL database, one for each company). So, if a new company will be created, Power BI report will recognize automatically that a new datasource is available and can show the data of new company/db.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jun 2023 06:56:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3299240#M43213</guid>
      <dc:creator>mferraricloudsu</dc:creator>
      <dc:date>2023-06-23T06:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL datasource selector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3303820#M43252</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/97653"&gt;@mferraricloudsu&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;It sounds like indireclty getting data requirement. You can store these company and correspond server information to a table and use power bi to getting data form that table.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Then you can simply use M query to getting data from specific row of the table records. (use these field values as connection strings to getting data)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:48:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Dynamic-SQL-datasource-selector/m-p/3303820#M43252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-27T07:48:08Z</dc:date>
    </item>
  </channel>
</rss>

