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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
tross4012
Helper I
Helper I

Rest API timeout due to large dataset

Thanks to @Daryl-Lynch-Bzy , I was able to get this GET working. The issue is that the dataset I need to generate is close to 412,000 rows. Does anyone know if there there is a way to:

1. Decrease the amount of time that the load takes?

2. Increase the time-out value that Power BI current has set? Currently, the load times-out when I set the offset <= 75000. 

 

tross4012_0-1650652159288.png

 

4 REPLIES 4
Anonymous
Not applicable

Where can I implement the Timeout clause in my call? Every place I insert it results in error. 

 

let
    Source = List.Generate( () => [offset = 0, getstudies = 1] , each [offset] <= 10000, each [offset = [offset] + 1000, getstudies = [offset] ], each [getstudies]),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Min"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([Min] <> 0)),
    #"Added Custom" = Table.AddColumn(#"Filtered Rows", "Max", each [Min] + 999),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Min", type text}, {"Max", type text}}),
    #"Add URL" = Table.AddColumn(#"Changed Type", "Add Url", each "https://ClinicalTrials.gov/api/query/study_fields?&fields=NCTId,LeadSponsorName,Phase,BriefTitle,OrgStudyID,OverallStatus&fmt=csv&max_rnk=" & [Max] & "&min_rnk=" & [Min], type text ),
    #"Get Data" = Table.AddColumn(#"Add URL", "Csv Data", each Table.PromoteHeaders( Table.Skip( Csv.Document(Web.Contents([Add Url]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),10))),
    #"Table Append" = Table.Combine( #"Get Data"[Csv Data] ),
    #"Sorted Rows" = Table.Sort(#"Table Append",{{"Rank", Order.Ascending}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Sorted Rows",{{"Rank", Int64.Type}}),
    #"Filtered Rows1" = Table.SelectRows(#"Changed Type1", each ([OverallStatus] <> "Completed" and [OverallStatus] <> "Terminated" and [OverallStatus] <> "Withheld")),
    #"Sorted Rows1" = Table.Sort(#"Filtered Rows1",{{"Rank", Order.Ascending}})
in
    #"Sorted Rows1"

 

Anonymous
Not applicable

Hi @tross4012 ,

Please update the applied codes in Advanced Editor as below, the part with red font is added ones...

let
Source = List.Generate( () => [offset = 0, getstudies = 1] , each [offset] <= 10000, each [offset = [offset] + 1000, getstudies = [offset] ], each [getstudies]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Min"}}),
#"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([Min] <> 0)),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "Max", each [Min] + 999),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Min", type text}, {"Max", type text}}),
#"Add URL" = Table.AddColumn(#"Changed Type", "Add Url", each "https://ClinicalTrials.gov/api/query/study_fields?&fields=NCTId,LeadSponsorName,Phase,BriefTitle,Org..." & [Max] & "&min_rnk=" & [Min], type text ),
#"Get Data" = Table.AddColumn(#"Add URL", "Csv Data", each Table.PromoteHeaders( Table.Skip( Csv.Document(Web.Contents([Add Url], [Timeout=#duration(0,0,15,0)]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),10))),
#"Table Append" = Table.Combine( #"Get Data"[Csv Data] ),
#"Sorted Rows" = Table.Sort(#"Table Append",{{"Rank", Order.Ascending}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Sorted Rows",{{"Rank", Int64.Type}}),
#"Filtered Rows1" = Table.SelectRows(#"Changed Type1", each ([OverallStatus] <> "Completed" and [OverallStatus] <> "Terminated" and [OverallStatus] <> "Withheld")),
#"Sorted Rows1" = Table.Sort(#"Filtered Rows1",{{"Rank", Order.Ascending}})
in
#"Sorted Rows1"

Best Regards

Unfortunately, i run into an error when placing the Timeout in the position mentioned. See pictures below:

tross4012_0-1651074871438.pngtross4012_1-1651074883070.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.