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
jmcgi2
New Member

Python API - Create/Push New Dataset

I am pulling 2 different tables from Google Big Query. Then I am joining them together and manipulating the data. Finally, I need to push this new data to Power BI using my Python Script. I do NOT want to put my Pyhton Script into Power BI and run it that way.

 

Thank you in advance for any information!

1 ACCEPTED SOLUTION

You get the API key when you create your Streaming dataset.   Push datasets work a little different.

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

All you need to do is call this API from your Python script. Doesn't even require authentication.

 

curl --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "[
{
\"Host\" :\"AAAAA555555\",
\"Timestamp\" :\"2024-09-24T17:15:51.558Z\",
\"Available Memory in MB\" :98.6,
\"Processor Load %\" :98.6,
\"% Free on C:\" :98.6,
\"img\" :\"AAAAA555555\",
\"Mashups\" :98.6,
\"Mashup Memory\" :98.6,
\"Gateway Memory\" :98.6,
\"Proxy ok\" :98.6,
\"% Free on D:\" :98.6,
\"Users\" :98.6
}
]" \
"https://api.powerbi.com/beta/<tenant id>/datasets/<dataset id>/rows?experience=power-bi&key=<api key>"

 

Note there is a slight difference between Push datasets and Streaming Datasets.

Thank you for the reponse. I work for Suabru and I believe I have to go by their security, would what you provided still work? I want to do it the correct way so IT does not get mad. Below is my code from reading the Power BI Python API. Let me know what you think!

 

jmcgi2_0-1727200699980.png

 

you are missing the /rows  part of the URL.

 Ok I see that now. Could you let me know where to insert it into my string? I do not have an API Key, unless you are calling the API Key like the client_id or something. Thanks again!

 

dataset_url = f'https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/datasets'

You get the API key when you create your Streaming dataset.   Push datasets work a little different.

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