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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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 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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.