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

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

Reply
smpa01
Super User
Super User

Custom REST calls

@gbrueckl  came across this fantastic piece . I have tested it out and it is simply awesome.

 

I was wondering if there is  a way to utilize any of the RESTApi calls here. For example, what if I want to know the refresh history of each dataset. The request URL is following

 

https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes

 

 

Is it doable? How do I make adjustments to the following to get the refresh history forEach dataset

 

WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('/groups', '${pbi_access_token}')) as workspace
)
SELECT workspace.name, workspace.id, pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${pbi_access_token}') as datasets
FROM cte_workspaces

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
gbrueckl
Most Valuable Professional
Most Valuable Professional

something like this should technically work

WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('https://api.powerbi.com/v1.0/myorg/groups', '${token}')) AS workspace
),
cte_datasets AS (
SELECT workspace.name AS ws_name, workspace.id AS ws_id, explode(pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${token}')) AS dataset
FROM cte_workspaces
)
SELECT ws_name, ws_id, dataset.name AS ds_name, dataset.id AS ds_id,
    explode(pbi_api_udf(concat(dataset.apiPath, '/refreshes'), '${token}')) AS refreshes
FROM cte_datasets

 but I just tried it on my quite small environment and it errors out with too many requests

View solution in original post

2 REPLIES 2
v-cboorla-msft
Community Support
Community Support

Hi @smpa01 

 

Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.

gbrueckl
Most Valuable Professional
Most Valuable Professional

something like this should technically work

WITH cte_workspaces AS (
    SELECT explode(pbi_api_udf('https://api.powerbi.com/v1.0/myorg/groups', '${token}')) AS workspace
),
cte_datasets AS (
SELECT workspace.name AS ws_name, workspace.id AS ws_id, explode(pbi_api_udf(concat(workspace.apiPath, '/datasets'), '${token}')) AS dataset
FROM cte_workspaces
)
SELECT ws_name, ws_id, dataset.name AS ds_name, dataset.id AS ds_id,
    explode(pbi_api_udf(concat(dataset.apiPath, '/refreshes'), '${token}')) AS refreshes
FROM cte_datasets

 but I just tried it on my quite small environment and it errors out with too many requests

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

Check out the February 2025 Fabric update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.