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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.