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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Atoma
Frequent Visitor

Read all data from dalux Api

Hello everyone,

I'm trying to link PowerBi to the opening API of an application we're using. Powerbi can only read data from one page. I would like it to read all the data. If you take the task. How can I read all the pages containing data? lien vers le .pbix 

4 REPLIES 4
dmbd1904
Helper III
Helper III

I think what you require is pagination and you could probably find some relevant information on google, or this forum. We work with the Dalux API a lot for our construciton clients but find it is more effective to work with it using the Data Engineering tools within Microsoft Fabric

v-xiandat-msft
Community Support
Community Support

Hi @Atoma ,

If you are trying to read all the pages from an API, you can use the REST API for Power BI. The API returns a list of pages within the specified report from My workspace. You can use this API(Reports - Get Pages)to get all the pages containing data. The required scope for this API is or Report.ReadWrite.AllReport.Read.All

Below is the official link will help you:
Reports - Get Pages - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you for your reply. This function lets you know how many pages the API contains. I just want powerbi to read all the pages containing data. As the number of pages can change, I would like this to be automatic. Without manually filling in the number of pages each time it is updated.

Atoma
Frequent Visitor

the code since is this one : 

let
Source = Json.Document(Web.Contents("https://field.dalux.com/service/api" & "/4.0/projects/6663914611/tasks", [Headers=[#"X-API-KEY"="290d553c-c523-43f1-9eb0-4f241ed51802"]])),
#"Converti en table" = Table.FromRecords({Source}),
#"items développé" = Table.ExpandListColumn(#"Converti en table", "items"),
#"items développé1" = Table.ExpandRecordColumn(#"items développé", "items", {"taskId", "subject", "usage", "type", "number", "created", "createdBy", "workflow", "location", "userDefinedFields"}, {"taskId", "subject", "usage", "type", "number", "created", "createdBy", "workflow", "location", "userDefinedFields"}),
#"type développé" = Table.ExpandRecordColumn(#"items développé1", "type", {"name"}, {"name"}),
#"createdBy développé" = Table.ExpandRecordColumn(#"type développé", "createdBy", {"userId"}, {"userId"}),
#"workflow développé" = Table.ExpandRecordColumn(#"createdBy développé", "workflow", {"name"}, {"name.1"}),
#"location développé" = Table.ExpandRecordColumn(#"workflow développé", "location", {"level", "room", "building", "drawing", "locationImages"}, {"level", "room", "building", "drawing", "locationImages"}),
#"level développé" = Table.ExpandRecordColumn(#"location développé", "level", {"name"}, {"name.2"}),
#"room développé" = Table.ExpandRecordColumn(#"level développé", "room", {"name"}, {"name.3"}),
#"building développé" = Table.ExpandRecordColumn(#"room développé", "building", {"name"}, {"name.4"}),
#"drawing développé" = Table.ExpandRecordColumn(#"building développé", "drawing", {"name"}, {"name.5"}),
#"locationImages développé" = Table.ExpandListColumn(#"drawing développé", "locationImages"),
#"locationImages développé1" = Table.ExpandRecordColumn(#"locationImages développé", "locationImages", {"name", "fileDownload"}, {"name.6", "fileDownload"}),
#"userDefinedFields développé" = Table.ExpandRecordColumn(#"locationImages développé1", "userDefinedFields", {"items"}, {"items"}),
#"items développé2" = Table.ExpandListColumn(#"userDefinedFields développé", "items"),
#"items développé3" = Table.ExpandRecordColumn(#"items développé2", "items", {"key", "name", "values"}, {"key", "name.7", "values"}),
#"metadata développé" = Table.ExpandRecordColumn(#"items développé3", "metadata", {"totalItems"}, {"totalItems"})
in
#"metadata développé"

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.