Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Dear all,
I have been referring to https://medium.com/@marktiedemann/how-to-do-pagination-in-power-query-430460c17c78 and a few posts like https://community.powerbi.com/t5/Desktop/Jira-Surpass-MaxRsults-gt-1000/m-p/1213351 for JIRA- power BI integration and getting > 1000 pulls at the same time.
No issues with the connection iself. However the pull contains only 2000 rows , while it has to contain 18250 rows.. would anyone be able to reveiw the code?
let
BaseUrl = "https://xxx.atlassian.net/rest/api/3/search?jql=project in ('QAS')",
JiraIDPerPage = 1000,
GetJson = (Url) =>
let
RawData = Web.Contents(Url),
Json = Json.Document(RawData)
in Json,
GetJiraIDCount = () =>
let Url = BaseUrl & "&maxResults=0",
Json = GetJson(Url),
Count = Json[#"total"]
in Count,
GetPage = (Index) =>
let Skip = "&startAt=" & Text.From(Index * JiraIDPerPage),
Top = "&maxResults=" & Text.From(JiraIDPerPage),
Url = BaseUrl & Skip & Top,
Json = GetJson(Url),
Value = Json[#"issues"]
in Value,
JiraIDCount = List.Max({ JiraIDPerPage, GetJiraIDCount() }),
PageCount = Number.RoundUp(JiraIDCount / JiraIDPerPage),
PageIndices = { 0 .. PageCount - 1 },
Pages = List.Transform(PageIndices, each GetPage(_)),
JiraID = List.Union(Pages),
Table = Table.FromList(JiraID, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
Table
When you troubleshoot
GetJiraIDCount = () =>
let Url = BaseUrl & "&maxResults=0",
Json = GetJson(Url),
Count = Json[#"total"]
in Count,
Does it actually return your expected count?
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
122 | |
101 | |
71 | |
61 |