<?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: Refresh API getting wrong data in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4079443#M36276</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="769992" data-lia-user-login="ViralGajjar2904" class="lia-mention lia-mention-user"&gt;ViralGajjar2904&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;The main reason for this problem is that power BI caches parameters and provides the latest values. When you open two websites, the two refresh operations are very close and there is a progress bar, which will cause the report to pick up parameters from the last trigger.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;You can consider: generating a new token for each session to ensure that the data is isolated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;If this post helps, then please consider&amp;nbsp;Accept it as the solution&amp;nbsp;and&amp;nbsp;kudos to this post&amp;nbsp;to help the other members find it more quickly&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 02:50:10 GMT</pubDate>
    <dc:creator>hackcrr</dc:creator>
    <dc:date>2024-08-05T02:50:10Z</dc:date>
    <item>
      <title>Refresh API getting wrong data</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4075808#M36255</link>
      <description>&lt;P&gt;I published below report in powerbi server by updating latest SessionId &amp;amp; BaseURL based on Client's interaction from webpage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;let&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; body="{""sessionId"": """&amp;amp; SessionIDPara &amp;amp;""",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ""isSearch"": false,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ""keyword"": """",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ""exploreType"": 2}",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Source=Json.Document(Web.Contents(BaseURLPara,&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RelativePath="/testAPI/explorer/location_hierarchy",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Content=Text.ToBinary(body),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Headers=[#"Content-Type"="application/json"]&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ])),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Converted to Table" = Record.ToTable(Source),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Value = #"Converted to Table"{1}[Value],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Converted to Table1" = Record.ToTable(Value),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Value1 = #"Converted to Table1"{0}[Value],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Parsed JSON" = Json.Document(Value1),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Converted to Table2" = Record.ToTable(#"Parsed JSON"),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Expanded Value" = Table.ExpandListColumn(#"Converted to Table2", "Value"),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"EntID", "EntityName", "Name", "Description", "Type", "Icon", "Room"}, {"EntID", "EntityName", "Name.1", "Description", "Type", "Icon", "Room"}),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Expanded Room" = Table.ExpandListColumn(#"Expanded Value1", "Room"),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Expanded Room1" = Table.ExpandRecordColumn(#"Expanded Room", "Room", {"EntID", "EntityName", "Name", "Description", "Type", "Icon", "Floor"}, {"EntID.1", "EntityName.1", "Name.2", "Description.1", "Type.1", "Icon.1", "Floor"}),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Expanded Floor" = Table.ExpandListColumn(#"Expanded Room1", "Floor"),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Expanded Floor1" = Table.ExpandRecordColumn(#"Expanded Floor", "Floor", {"EntID", "EntityName", "Name", "Description", "Type", "Icon", "HasChildren"}, {"EntID.2", "EntityName.2", "Name.3", "Description.2", "Type.2", "Icon.2", "HasChildren"}),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Renamed Columns1" = Table.RenameColumns(#"Expanded Floor1",{{"EntID", "Parent ID"}, {"Name.1", "Site Name"}, {"Type", "Room Type"}, {"Name.2", "Room Name"}, {"Name.3", "Floor Name"}}),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns1",{"Description", "Icon", "Description.1", "Icon.1", "Description.2", "Icon.2"}),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([EntID.1] &amp;lt;&amp;gt; null))&lt;/DIV&gt;&lt;DIV&gt;in&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; #"Filtered Rows"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have two urls for testing purpose.&lt;/DIV&gt;&lt;DIV&gt;1) n20a.netzoom.com&lt;/DIV&gt;&lt;DIV&gt;2) 20.netzoom.com&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;when I open n20a.netzoom.com &amp;amp; try to access powerbi report, then BaseURL &amp;amp; Sessionid will be fetched from webpage dynamically &amp;amp; update parameter &amp;amp; refresh API will be call.Refresh take 10 seconds to complete.In between above process when i open 20.netzoom.com the&amp;nbsp;BaseURL &amp;amp; Sessionid will be fetched from its webpage dynamically &amp;amp; parameter update.&lt;BR /&gt;But after completed first user's (n20a.netzoom.com) refresh API I am getting data of second user(20.netzoom.com)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I don't know why this is happen...I embed report using embed token, still I am not getting actual data.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can anybody know this issue &amp;amp; how to solve it?&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Aug 2024 10:58:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4075808#M36255</guid>
      <dc:creator>ViralGajjar2904</dc:creator>
      <dc:date>2024-08-02T10:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh API getting wrong data</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4079443#M36276</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="769992" data-lia-user-login="ViralGajjar2904" class="lia-mention lia-mention-user"&gt;ViralGajjar2904&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;The main reason for this problem is that power BI caches parameters and provides the latest values. When you open two websites, the two refresh operations are very close and there is a progress bar, which will cause the report to pick up parameters from the last trigger.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;You can consider: generating a new token for each session to ensure that the data is isolated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;If this post helps, then please consider&amp;nbsp;Accept it as the solution&amp;nbsp;and&amp;nbsp;kudos to this post&amp;nbsp;to help the other members find it more quickly&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 02:50:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4079443#M36276</guid>
      <dc:creator>hackcrr</dc:creator>
      <dc:date>2024-08-05T02:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh API getting wrong data</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4080184#M36281</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="740391" data-lia-user-login="hackcrr" class="lia-mention lia-mention-user"&gt;hackcrr&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;should I have to generate unique&amp;nbsp; embed token for user wise?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I already configured code for generate embed token, but&amp;nbsp; I do not have multi users for testing purpose.&lt;BR /&gt;I am aceessing reports form both websites (n20.netzoom.com &amp;amp; 20.netzoom.com) via Single user, so it might be cretae above problem? I am not sure...!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please suggets how to use embed token once generated.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 07:11:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4080184#M36281</guid>
      <dc:creator>ViralGajjar2904</dc:creator>
      <dc:date>2024-08-05T07:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh API getting wrong data</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4083014#M36302</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="769992" data-lia-user-login="ViralGajjar2904" class="lia-mention lia-mention-user"&gt;ViralGajjar2904&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample API call to generate an embed token:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import requests
import json

def generate_embed_token(username, report_id, dataset_id, workspace_id):
    url = "https://api.powerbi.com/v1.0/myorg/reports/{report_id}/GenerateToken"

    payload = json.dumps({
        "accessLevel": "View",
        "identities": [
            {
                "username": username,
                "roles": ["Viewer"],
                "datasets": [dataset_id]
            }
        ]
    })
    headers = {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
    }

    response = requests.request("POST", url.format(report_id=report_id), headers=headers, data=payload)

    if response.status_code == 200:
        return response.json()['token']
    else:
        raise Exception(f"Error generating embed token: {response.text}")

# Example usage:
embed_token = generate_embed_token("user@example.com", "report_id", "dataset_id", "workspace_id")
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ensure that your embedded report uses the token generated for the specific user session. This can be done in your client-side code where the Power BI report is embedded:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;var embedToken = 'USER_SPECIFIC_EMBED_TOKEN';
var reportId = 'YOUR_REPORT_ID';
var groupId = 'YOUR_GROUP_ID';
var embedUrl = `https://app.powerbi.com/reportEmbed?reportId=${reportId}&amp;amp;groupId=${groupId}`;

var models = window['powerbi-client'].models;
var embedConfig = {
    type: 'report',
    tokenType: models.TokenType.Embed,
    accessToken: embedToken,
    embedUrl: embedUrl,
    id: reportId,
    permissions: models.Permissions.All,
    settings: {
        filterPaneEnabled: false,
        navContentPaneEnabled: true
    }
};

// Embed the report and display it within the div container.
var reportContainer = document.getElementById('reportContainer');
var report = powerbi.embed(reportContainer, embedConfig);
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use different browser sessions or incognito windows to simulate multiple users accessing the report. Ensure that each session generates and uses a unique embed token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post helps, then please consider&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;kudos to this post&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 04:58:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Refresh-API-getting-wrong-data/m-p/4083014#M36302</guid>
      <dc:creator>hackcrr</dc:creator>
      <dc:date>2024-08-06T04:58:50Z</dc:date>
    </item>
  </channel>
</rss>

