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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
hjoshi4u26
Regular Visitor

Dynamic Dataset refresh error

I have a list of Pull Request IDs from which I have to get the data via REST APIs. I am able to fetch the data locally, but when I publish it to PowerBI Service, I face the 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."

hjoshi4u26_0-1681477278108.png

Sharing below the M-Code:
let
Source = SharePoint.Files("https://*******.sharepoint.com/teams/*****", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "Pull Request List Sample.xlsx")),
#"Pull Request List Sample xlsx_https://****** sharepoint com/teams/*********/Shared Documents/General/*************" = #"Filtered Rows"{[Name="Pull Request List Sample.xlsx",#"Folder Path"="https://**********.sharepoint.com/teams/*********/Shared Documents/General/********"]}[Content],
#"Imported Excel Workbook" = Excel.Workbook(#"Pull Request List Sample xlsx_https://******* sharepoint com/teams/********/Shared Documents/General/*********"),
PR_Table = #"Imported Excel Workbook"{[Item="PR",Kind="Table"]}[Data],
#"Changed Type2" = Table.TransformColumnTypes(PR_Table,{{"Pull Request Id", type text}}),
#"Pull Request API" = Table.AddColumn(#"Changed Type2", "Pull Request API", each "https://*************.com/******/_apis/git/pullrequests/"&[Pull Request Id]&"?api-version=7.0", Text.Type),
#"Transformed to Binary" = Table.TransformColumns(#"Pull Request API", {{"Pull Request API", VSTS.Contents}}),
#"Transformed to Json" = Table.TransformColumns(#"Transformed to Binary", {{"Pull Request API", Json.Document}}),
#"Expanded Pull Request API" = Table.ExpandRecordColumn(#"Transformed to Json", "Pull Request API", {"closedDate","closedBy"}, {"Closed Date", "Closed By"}),
#"Expanded Closed By" = Table.ExpandRecordColumn(#"Expanded Pull Request API", "Closed By", {"displayName"}, {"Closed By"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Closed By",{{"Closed By", type text}, {"Title", type text}})
in
#"Changed Type1"

.

.

Note: Pull Request Id data type is Text so used '&' to combine it to create API URL. But facing the error as mentioned.

I have read Chris Webbs Blog but did not understand it properly.

 

Can anyone please let me know how can I solve this error..? Any help would be much appreciated. Thanks in advabce 🙂

1 ACCEPTED SOLUTION
hjoshi4u26
Regular Visitor

No worries. I have done it. Sharing the steps below. Initially I was doing below steps to get REST API Output in Json Records:-->

#"Pull Request API" = Table.AddColumn(#"Changed Type2", "Pull Request API", each "https://*************.com/******/_apis/git/pullrequests/"&[Pull Request Id]&"?api-version=7.0", Text.Type),
#"Transformed to Binary" = Table.TransformColumns(#"Pull Request API", {{"Pull Request API", VSTS.Contents}}),
#"Transformed to Json" = Table.TransformColumns(#"Transformed to Binary", {{"Pull Request API", Json.Document}}),

.

But instead I did this:-->
#"Pull Request API" = Table.AddColumn(#"Changed Type2", "Pull Request API",each
     Json.Document(
          VSTS.Contents(

               "https://************.com/**********/_apis/git/pullrequests/",

               [RelativePath = [Pull Request Id]&"?api-version=7.0"]

          )

     )
),

.

This solved my problem. I watched a youtube video which explains very easily how to do it, sharing the link below.

https://youtu.be/sv_upbpq_Cw

View solution in original post

1 REPLY 1
hjoshi4u26
Regular Visitor

No worries. I have done it. Sharing the steps below. Initially I was doing below steps to get REST API Output in Json Records:-->

#"Pull Request API" = Table.AddColumn(#"Changed Type2", "Pull Request API", each "https://*************.com/******/_apis/git/pullrequests/"&[Pull Request Id]&"?api-version=7.0", Text.Type),
#"Transformed to Binary" = Table.TransformColumns(#"Pull Request API", {{"Pull Request API", VSTS.Contents}}),
#"Transformed to Json" = Table.TransformColumns(#"Transformed to Binary", {{"Pull Request API", Json.Document}}),

.

But instead I did this:-->
#"Pull Request API" = Table.AddColumn(#"Changed Type2", "Pull Request API",each
     Json.Document(
          VSTS.Contents(

               "https://************.com/**********/_apis/git/pullrequests/",

               [RelativePath = [Pull Request Id]&"?api-version=7.0"]

          )

     )
),

.

This solved my problem. I watched a youtube video which explains very easily how to do it, sharing the link below.

https://youtu.be/sv_upbpq_Cw

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.