A customer of mine was struggling with retrieving Goals from a Power BI Scorecard using Power Automate and the Power BI Connector, it kept generating the error! 😤
This is the error message.
The given key was not present in the dictionary. function: ProjectGoalValueAggregations last line: 11
I wanted to see I could replicate the challenge, so I created a sample Scorecard in a Power BI Workspace.

It took a little bit to figure out what was causing the error, but I finally figured it out 🥳… it was the custom Statuses.

From what I can tell the Status, as far as how the Power BI Connector works, it seems to be restricting to values between 0
and 5
.

Any additional Statuses that were added, generated an error, and I also note that any of the standard statuses that were renamed, would return the original name, even though it had been changed! 😤
I got to work on a possible workaround, starting with the HTTP Connector in Power Automate.
The first thing I needed to do was create an App Registration (referred to later as Service Principal) in Azure ☁️ with the appropriate API Permissions. 🔐
Dataset.Read.All
Dataset.ReadWrite.All

I needed to Grant admin consent for the API Permission.
I also created a Client Secret that I will need to use in my HTTP calls.
I enabled Service principals can use Fabric APIs in the Power BI Admin Portal.
- Click the Gear icon.
- Search for
principal
in the Search Box. - Toggle Service principals can use Fabric APIs to
Enabled
.

I gave my Service Principal Admin
access to the Workspace.

Now I am ready to build the flow! 🙃
I created three Environment variables to store the Client Id, Client Secret and Tenant Id for the Service Principal.

I will share the Solution at the end of this article, but in the meantime, I will share the HTTP actions of the flow, as that is where the heavy lifting takes place.
Right now, I am using a Manually trigger a flow trigger that includes two parameters, GroupId, the unique identifier of the Workspace, and ScorecardId, the unique identifier of the Scorecard.

I am using the API call to get Goals found at Goals (Preview) – Get – REST API (Power BI Power BI REST APIs) | Microsoft Learn.

The JSON returned includes a list of all Goals and Aggregations, the Aggregations include the Value
, Target
and Status
.

I did end up flatten the JSON structure to make it easier to work with.

Not as easy to use as the Power BI Connector, but gets the job done correctly! ☑️
Check it out for yourself 👀 at https://mattruma.com/wp-content/uploads/2025/05/PowerBISolution_1_0_0_1.zip.
Discover more from Matt Ruma
Subscribe to get the latest posts sent to your email.