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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Problem Creating Scorecard using API

Hi,

 

I have a problem creating a Scorecard using API, the scorecard appears and it seems to be ok but 5 seconds later the link won't work and I can't add goals later, I would like to know how to create one successfully.

If anyone can help I'll appreciate.  Thanks

With Postman I made a POST to https://api.powerbi.com/v1.0/myorg/groups/{WorkspaceId}/scorecards/

Headers
Content-Type  application/json
Authorization  Bearer access_token

With this Body JSON

{
  "name""Scorecard Test",
  "groupId""af8xxxxxx-1cd8-4607-xxxx-xxxxxxx44f2d8",
  "contact""email@server.com",
  "permissions""ReadWrite",
  "localTimeZoneId""Romance Standard Time",
  "statuses": [
    {
      "id"4,
      "displayName""Overdue",
      "color""#FED9CC",
      "historical"false
    },
    {
      "id"3,
      "displayName""Behind",
      "color""#FDE7E9",
      "historical"false
    },
    {
      "id"2,
      "displayName""At risk",
      "color""#FFF4CE",
      "historical"false
    },
    {
      "id"1,
      "displayName""On track",
      "color""#DFF6DD",
      "historical"false
    },
    {
      "id"0,
      "displayName""Not started",
      "color""#F3F2F1",
      "historical"false
    },
    {
      "id"5,
      "displayName""Completed",
      "color""#CCDEFF",
      "historical"false
    }
  ],
  "goalStatuses": {
    "nextId"6,
    "statuses": [
      {
        "id"4,
        "displayName""Overdue",
        "color""#FED9CC",
        "historical"false
      },
      {
        "id"3,
        "displayName""Behind",
        "color""#FDE7E9",
        "historical"false
      },
      {
        "id"2,
        "displayName""At risk",
        "color""#FFF4CE",
        "historical"false
      },
      {
        "id"1,
        "displayName""On track",
        "color""#DFF6DD",
        "historical"false
      },
      {
        "id"0,
        "displayName""Not started",
        "color""#F3F2F1",
        "historical"false
      },
      {
        "id"5,
        "displayName""Completed",
        "color""#CCDEFF",
        "historical"false
      }
    ]
  },
  "columnSettings": [
    { "columnId"0"show"true },
    { "columnId"1"show"true },
    { "columnId"2"show"true },
    { "columnId"3"show"true },
    { "columnId"4"show"true },
    { "columnId"5"show"true },
    { "columnId"6"show"true },
    { "columnId"7"show"false },
    { "columnId"8"show"false },
    { "columnId"9"show"false },
    { "columnId"10"show"true }
  ],
  "notificationsSetting"1,
  "goals": [
    {
      "goalId"1,
      "displayName""Goal 1",
      "description""Achieve sales target",
      "value"100,
      "status"1,
      "completionDate""2025-12-31"
    },
    {
      "goalId"2,
      "displayName""Goal 2",
      "description""Reduce response time",
      "value"50,
      "status"0,
      "completionDate""2025-06-30"
    }
  ]
}
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Anonymous 
Thanks for reaching out to the Microsoft fabric community forum.

Based on my practical tests, I recommend separating the creation of the scorecard from the creation of the objectives:

 

1.First, create the scorecard:

Call the following API:

 

 

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/scorecards

 

 

Here is my example body:

 

 

{
  "name": "Scorecard Test2",
  "contact": "yy@xx.com",
  "permissions": "ReadWrite",
  "localTimeZoneId": "UTC",
  "statuses": [
    {
      "id": 0,
      "displayName": "Not started",
      "color": "#F3F2F1",
      "historical": false
    },
    {
      "id": 1,
      "displayName": "On track",
      "color": "#DFF6DD",
      "historical": false
    },
    {
      "id": 2,
      "displayName": "At risk",
      "color": "#FFF4CE",
      "historical": false
    },
    {
      "id": 3,
      "displayName": "Behind",
      "color": "#FDE7E9",
      "historical": false
    },
    {
      "id": 4,
      "displayName": "Overdue",
      "color": "#FED9CC",
      "historical": false
    },
    {
      "id": 5,
      "displayName": "Completed",
      "color": "#CCDEFF",
      "historical": false
    }
  ],
  "columnSettings": [
    { "columnId": 0, "show": true },
    { "columnId": 1, "show": true },
    { "columnId": 2, "show": true },
    { "columnId": 3, "show": true },
    { "columnId": 4, "show": true },
    { "columnId": 5, "show": true },
    { "columnId": 6, "show": true },
    { "columnId": 7, "show": false },
    { "columnId": 8, "show": false },
    { "columnId": 9, "show": false },
    { "columnId": 10, "show": true }
  ]
}

 

 

The result is as follows:

vlinyulumsft_0-1740380693740.png

 

2.Next, create the objectives:

Call the following API:

 

 

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/scorecards({scorecardId})/goals

 

 

Here is my example body:

 

 

{
  "goalId": 2,
  "name": "Achieve Sales Target2",
  "description": "Achieve sales targets",
  "value": 100,
  "status": 1,
  "completionDate": "2025-12-31"
}

 

 

The result is as follows:

vlinyulumsft_3-1740380799048.png

vlinyulumsft_5-1740380867962.png

3.In my tests, if merged, the api would not recognize goals, resulting in a blank space:

vlinyulumsft_0-1740446919507.png

4.For more details, please refer to:

Goals (Preview) - Post - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Scorecards (Preview) - Post - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Anonymous 
Thanks for reaching out to the Microsoft fabric community forum.

Based on my practical tests, I recommend separating the creation of the scorecard from the creation of the objectives:

 

1.First, create the scorecard:

Call the following API:

 

 

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/scorecards

 

 

Here is my example body:

 

 

{
  "name": "Scorecard Test2",
  "contact": "yy@xx.com",
  "permissions": "ReadWrite",
  "localTimeZoneId": "UTC",
  "statuses": [
    {
      "id": 0,
      "displayName": "Not started",
      "color": "#F3F2F1",
      "historical": false
    },
    {
      "id": 1,
      "displayName": "On track",
      "color": "#DFF6DD",
      "historical": false
    },
    {
      "id": 2,
      "displayName": "At risk",
      "color": "#FFF4CE",
      "historical": false
    },
    {
      "id": 3,
      "displayName": "Behind",
      "color": "#FDE7E9",
      "historical": false
    },
    {
      "id": 4,
      "displayName": "Overdue",
      "color": "#FED9CC",
      "historical": false
    },
    {
      "id": 5,
      "displayName": "Completed",
      "color": "#CCDEFF",
      "historical": false
    }
  ],
  "columnSettings": [
    { "columnId": 0, "show": true },
    { "columnId": 1, "show": true },
    { "columnId": 2, "show": true },
    { "columnId": 3, "show": true },
    { "columnId": 4, "show": true },
    { "columnId": 5, "show": true },
    { "columnId": 6, "show": true },
    { "columnId": 7, "show": false },
    { "columnId": 8, "show": false },
    { "columnId": 9, "show": false },
    { "columnId": 10, "show": true }
  ]
}

 

 

The result is as follows:

vlinyulumsft_0-1740380693740.png

 

2.Next, create the objectives:

Call the following API:

 

 

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/scorecards({scorecardId})/goals

 

 

Here is my example body:

 

 

{
  "goalId": 2,
  "name": "Achieve Sales Target2",
  "description": "Achieve sales targets",
  "value": 100,
  "status": 1,
  "completionDate": "2025-12-31"
}

 

 

The result is as follows:

vlinyulumsft_3-1740380799048.png

vlinyulumsft_5-1740380867962.png

3.In my tests, if merged, the api would not recognize goals, resulting in a blank space:

vlinyulumsft_0-1740446919507.png

4.For more details, please refer to:

Goals (Preview) - Post - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Scorecards (Preview) - Post - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have been unable to get these API calls to work with SPN authentication through MS Fabric notebooks.  How are you authenticating?  I am able to get the APIs to work if I "borrow" my user auth token from my personal session.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.