<?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: Doubt about embed token and filtering. in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275040#M8294</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a new user of Power Bi embedded (developing a webapp using javascript sdk) and I have two doubts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Its still not clear how to get the acess token from Azure, should I just make a post request to this (&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{group_Id}/reports/{report_id}/GenerateToken" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/{group_Id}/reports/{report_id}/GenerateToken&lt;/A&gt;) api?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I want to be able to filter the report before it even loads ( I am creating reports for my clients, but I want to filter them by their ID, because one client may not see each others information), is it possible to do so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 21:09:41 GMT</pubDate>
    <dc:creator>tenenwurcel</dc:creator>
    <dc:date>2017-10-10T21:09:41Z</dc:date>
    <item>
      <title>Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275045#M8265</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am developing a web app using Power Bi Embedded (using javascript sdk), and I have two doubts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. It is still not clear how to get the access token. Should I just make a post request to the api (&lt;SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{group_Id}/reports/{report_id}/GenerateToken" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/{group_Id}/reports/{report_id}/GenerateToken&lt;/A&gt;)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. I want to be able to filter my report even before it loads, ( I am creating an app so my clients can see their data through a Power Bi report, but I want to filter it by their IDs even before it loads, because one client may not see each other data) is it possible to do so?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:15:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275045#M8265</guid>
      <dc:creator>tenenwurcel</dc:creator>
      <dc:date>2017-10-10T21:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275040#M8294</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a new user of Power Bi embedded (developing a webapp using javascript sdk) and I have two doubts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Its still not clear how to get the acess token from Azure, should I just make a post request to this (&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{group_Id}/reports/{report_id}/GenerateToken" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/{group_Id}/reports/{report_id}/GenerateToken&lt;/A&gt;) api?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I want to be able to filter the report before it even loads ( I am creating reports for my clients, but I want to filter them by their ID, because one client may not see each others information), is it possible to do so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:09:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275040#M8294</guid>
      <dc:creator>tenenwurcel</dc:creator>
      <dc:date>2017-10-10T21:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275439#M8266</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="44057" data-lia-user-login="tenenwurcel" class="lia-mention lia-mention-user"&gt;tenenwurcel&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the first question: The token is generated by the Power BI Api, you just need to configure properly your web config. Follow these steps:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content" target="_blank"&gt;https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And for the second one you can use this demo code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;html&amp;gt;

 &amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;  
 &amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js""&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;
var embedConfiguration = {
    type: 'report',
    accessToken: 'token',
    embedUrl: 'embedURL' 
}; 

var report;

window.onload = function () { 

var $reportContainer = $('#reportContainer');
 
 report= powerbi.embed($reportContainer.get(0), embedConfiguration);
 
 
 &lt;STRONG&gt;var Filter1 = {
$schema: "http://powerbi.com/product/schema#advanced",
target: {
table: "Table1",
column: "T1id"
},
logicalOperator: "OR",
conditions: [
{
operator: "Contains",
value: "id1"
} 
]
}&lt;/STRONG&gt;
 
report.on('loaded', event =&amp;gt; {
  report.getFilters()
    .then(filters =&amp;gt; {
	
      filters.push(Filter1); 

      return report.setFilters(filters);
    });
});
 
} 


function reloadreport(){ 

var $reportContainer = $('#reportContainer');
powerbi.embedNew($reportContainer.get(0), embedConfiguration);

};
&amp;lt;/script&amp;gt;
  
&amp;lt;div id="reportContainer"&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;/html&amp;gt;  &lt;/PRE&gt;&lt;P&gt;Hope it works for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Julian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 04:12:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/275439#M8266</guid>
      <dc:creator>Juramirez</dc:creator>
      <dc:date>2017-10-11T04:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/276286#M8286</link>
      <description>&lt;P&gt;Hey Juramirez,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all thank you so much for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you&amp;nbsp;misunderstood what I meant about the filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to load a new filter pane, I want to be able to filter the report even before it loads, because I want my clients to not see each other data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So lets say I have a report regarding to 3 clients cli1, cli2 and cli3. So when cli1 is using the web app and load the report I want him to only see the data regarding to cli1 and not be able to see the data regarding to cli2 and cli3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to do so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank so much once again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Henrique.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 17:05:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/276286#M8286</guid>
      <dc:creator>tenenwurcel</dc:creator>
      <dc:date>2017-10-11T17:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/276473#M8290</link>
      <description>&lt;P&gt;Q1.&amp;nbsp; You can follow these instructions to generate a token.&amp;nbsp; You will need to know C#.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content/" target="_blank"&gt;https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q2. The filtering you are describing is called RLS(Row Level Security).&amp;nbsp; You can pass in role when generating your token request that would allow each client to see their own data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List&amp;lt;EffectiveIdentity&amp;gt; { new EffectiveIdentity(username: "username", roles: new List&amp;lt;string&amp;gt; { "roleA", "roleB" }, datasets: new List&amp;lt;string&amp;gt; { "datasetId" }) });

var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("groupId", "reportId", generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 03:06:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/276473#M8290</guid>
      <dc:creator>jamesyoung</dc:creator>
      <dc:date>2017-10-12T03:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/306000#M9002</link>
      <description>&lt;P&gt;&lt;SPAN&gt;2. I want to be able to filter my report even before it loads, ( I am creating an app so my clients can see their data through a Power Bi report, but I want to filter it by their IDs even before it loads, because one client may not see each other data) is it possible to do so?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm currently using the Api Rest from python i've add my custom report in my application getting a embed token and i've been reading about add filter in my report, but just i've find information about how i can how do with the JavaScript SDK but i dont have information how i can add a filter through the Api Rest , someone could give to me some information about that, &amp;nbsp;How can i add filter to report through the Api Rest i had reading that &lt;A href="http://docs.powerbi.apiary.io/#" target="_blank"&gt;http://docs.powerbi.apiary.io/#&lt;/A&gt; (sorry for my english haha)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 17:31:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/306000#M9002</guid>
      <dc:creator>oscar_net</dc:creator>
      <dc:date>2017-11-17T17:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/306001#M9003</link>
      <description>&lt;P&gt;&lt;SPAN&gt;2. I want to be able to filter my report even before it loads, ( I am creating an app so my clients can see their data through a Power Bi report, but I want to filter it by their IDs even before it loads, because one client may not see each other data) is it possible to do so?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm currently using the Api Rest from python i've add my custom report in my application getting a embed token and i've been reading about add filter in my report, but just i've find information about how i can how do with the JavaScript SDK but i dont have information how i can add a filter through the Api Rest , someone could give to me some information about that, &amp;nbsp;How can i add filter to report through the Api Rest i had reading that &lt;A href="http://docs.powerbi.apiary.io/#" target="_blank"&gt;http://docs.powerbi.apiary.io/#&lt;/A&gt; (sorry for my english haha)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 17:34:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/306001#M9003</guid>
      <dc:creator>oscar_net</dc:creator>
      <dc:date>2017-11-17T17:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about embed token and filtering.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/306243#M9006</link>
      <description>&lt;P&gt;Here is the information on adding filters through JavaScript API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters" target="_blank"&gt;https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 19:12:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Doubt-about-embed-token-and-filtering/m-p/306243#M9006</guid>
      <dc:creator>jamesyoung</dc:creator>
      <dc:date>2017-11-18T19:12:20Z</dc:date>
    </item>
  </channel>
</rss>

