Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pbiguru123
Helper I
Helper I

API loads in desktop but "dynamic data" in service

hello everyone, i have a jira connection

 

 

let
    FetchData = (accessToken as text, url as text, clientid as text) =>
    let
        URL = url,
        path = "api/export/power-bi/" & clientid,
        AuthHeader = "Basic " & Binary.ToText(Text.ToBinary("My Username:" & accessToken), BinaryEncoding.Base64),
        Source = Json.Document(Web.Contents(URL, [RelativePath = path, Headers=[Authorization=AuthHeader]])),
        #"Converted to Table" = Table.FromRecords({Source}),
        #"Expanded value" = Table.ExpandListColumn(#"Converted to Table", "value"),
        #"Expanded value1" = Table.ExpandRecordColumn(#"Expanded value", "value", {"name", "kind", "url"}, {"value.name", "value.kind", "value.url"}),
    #"Added Custom" = Table.AddColumn(#"Expanded value1", "SessionId", each Text.AfterDelimiter([value.url], "sessionId=")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Full URL", each Text.BeforeDelimiter([#"@odata.context"], "/$metadata")),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom1", "Full URL", Splitter.SplitTextByEachDelimiter({"/"}, QuoteStyle.Csv, true), {"Full URL", "Full URL.2"}),
    #"Added Custom2" = Table.AddColumn(#"Split Column by Delimiter", "URL", each Text.BeforeDelimiter([Full URL], "/api")),
    #"Added Custom3" = Table.AddColumn(#"Added Custom2", "Path", each Text.AfterDelimiter([Full URL], ".com/")),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom3",{"@odata.context", "value.kind", "value.url", "Full URL", "Full URL.2", "URL"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"value.name", "TableName"}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns",{"Path", "TableName", "SessionId"})
in
    #"Reordered Columns"
in
    FetchData

 

 


this first function will return the url path, session id and table names for each of my clients

then i have another function

 

 

let
    FetchData = (accessToken as text, url as text, Path as text, ClientID as text, TableName as text, SessionId as text) =>
    let
        URL = url,
        path = Path & "/" & ClientID & "/" & TableName,
        Q = 
        [
            sessionId = SessionId
        ],
        AuthHeader = "Basic " & Binary.ToText(Text.ToBinary("My Username:" & accessToken), BinaryEncoding.Base64),
        Source = Json.Document(Web.Contents(URL, [RelativePath = path, Query = Q, Headers=[Authorization=AuthHeader]])),
        #"Converted to Table" = Table.FromRecords({Source})
    in
        #"Converted to Table"
in
    FetchData

 

 


the data loads in powerbi desktop and am able to build my dashboard but as soon as i publish and try to refresh in powerbi service, i get the dreadful error

This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. Learn more: https://aka.ms/dynamic-data-sources.

Data source for Query1

I used the relative path and query in the web content and as i said the data works and loads but in service, no avail. any solutions?

 

 

1 REPLY 1
lbendlin
Super User
Super User

Is your url - when called by itself - returning a meaningful http response?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors