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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
JOAOLBMARTINS
Helper II
Helper II

GOALS Rest API - Expanding on Values & Notes via PowerShell

Hey Community, 

 

Hope everybody is doing well.

 

I'm trying to develop a PowerShell script to colect not only Goals but its values and notes in one single line of code (without the need to loop over the Goals collection).

Following the documention, it seems that we have the possibility to "expand" the notes when we're selecting the GoalsValues:

 

JOAOLBMARTINS_0-1652981816781.png

 

I've already tried this one and it works only for expanding the goals values:

myURL = 

 
I'm trying the two scenarios below:
 
First one that is not working is to fetch goals values and notes at once using the following URL:
$myURL="https://api.powerbi.com/v1.0/myOrg/groups/$workspaceId/scorecards($scorecardId)?`$expand=goals(`$expand=goalValues(`$expand=notes))"
 
The second option, is to expand over goalValues only:
This one works, but the "notes" field returns empty/blank (or maybe I'm not knowing how to access it).
 
My last option and the only that works is the following:
$myURL="https://api.powerbi.com/v1.0/myOrg/groups/$workspaceId/scorecards($scorecardId)/goals($goalId)/goalValues(2022-05-14T00:00:00Z)?`$expand=notes"
However, to be able to get the note, I not only need to pass a GoalID but also the timestamp I want to retrieve the note.
 
Does anyone already played with the REST API for Goals and can give a way to access all the goals, values and notes at once?
 
Cheers,
 
João Martins

 

2 REPLIES 2
Anonymous
Not applicable

Hi @JOAOLBMARTINS,

I check the document but did not find any existed API that allows for bulk operation with multiple goals.
So I think you need to write a loop to invoke the single request multiple times with different parameters.

Regards,

Xiaoxin Sheng

Ohh that's a shame. I really didn't want to loop over all the notes in all the goals to copy from one to another scorecard

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.