Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin 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
I have a REST API query that I need to load into Power BI and the API limits data in 180 day increments per API call. If I have over 2 years of data to load, I thought I could create a table called TRIMESTERS with a list of various date ranges such as this:
How do I reference the above dates in the query below for the saleTimestampRange filter?
let
Source = Xml.Tables(Web.Contents("https://xxxxxxx/recurringservices?" & "saleTimestampRange=2018-05-01", [Headers=[app_id="xxxxxxx", app_key="xxxxxxx"]])),
Table2 = Source{2}[Table],
Table0 = Table2{0}[Table],
#"Changed Type" = Table.TransformColumnTypes(Table0,{{"recurringServiceId", type text}, {"createTimestamp", type datetime}, {"memberId", type text}, {"agreementNumber", Int64.Type}, {"memberFirstName", type text}, {"memberLastName", type text}, {"salesPersonId", type text}, {"salesPersonFirstName", type text}, {"salesPersonLastName", type text}, {"recurringServicePlanId", type text}, {"recurringServiceStatus", type text}, {"recurringServiceSubStatus", type text}, {"recurringTypeDesc", type text}, {"numberBilled", Int64.Type}, {"totalPeriods", type text}, {"invoiceTotal", Int64.Type}, {"frequency", type text}, {"reorderQuantity", Int64.Type}, {"serviceItem", type text}, {"unitPrice", Int64.Type}, {"autoRenew", type logical}, {"purchasedClub", Int64.Type}, {"serviceEmployeeId", type text}, {"serviceEmployeeFirstName", type text}, {"serviceEmployeeLastName", type text}, {"campaignName", type text}}),
#"Expanded recurringServiceDates" = Table.ExpandTableColumn(#"Changed Type", "recurringServiceDates", {"saleDate", "firstBillingDate", "inactiveDate", "deactivateReason", "lastModifiedTimestamp", "nextBillingDate"}, {"recurringServiceDates.saleDate", "recurringServiceDates.firstBillingDate", "recurringServiceDates.inactiveDate", "recurringServiceDates.deactivateReason", "recurringServiceDates.lastModifiedTimestamp", "recurringServiceDates.nextBillingDate"}),
#"Expanded commissionsEmployeeIds" = Table.ExpandTableColumn(#"Expanded recurringServiceDates", "commissionsEmployeeIds", {"commissionsEmployeeId"}, {"commissionsEmployeeIds.commissionsEmployeeId"})
in
#"Expanded commissionsEmployeeIds"
Solved! Go to Solution.
Hi @patelaz
You can convert your API Query into a function, something like below.
( dates as text ) => let
Source = Xml.Tables(Web.Contents("https://xxxxxxx/recurringservices?saleTimestampRange=" & dates, [Headers=[app_id="xxxxxxx", app_key="xxxxxxx"]])),
Table2 = Source{2}[Table],
Table0 = Table2{0}[Table]
in
Table0
And later In your dates table go to Add Column ribbon > Invoke Custom Funktion and adjust the setting to reflect the below.
Hi @patelaz
You can convert your API Query into a function, something like below.
( dates as text ) => let
Source = Xml.Tables(Web.Contents("https://xxxxxxx/recurringservices?saleTimestampRange=" & dates, [Headers=[app_id="xxxxxxx", app_key="xxxxxxx"]])),
Table2 = Source{2}[Table],
Table0 = Table2{0}[Table]
in
Table0
And later In your dates table go to Add Column ribbon > Invoke Custom Funktion and adjust the setting to reflect the below.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |