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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
stchln
Resolver I
Resolver I

PowerShell export table of

Hello,

I would like to export using PowerShell one table from one dataflow of a given workspace but I cannot find the command...

 

Using PowerQuery in PowerBI Desktop, this is as below

 

 

 

 

let
    Source = PowerBI.Dataflows(null),
    WS = Source{[workspaceId="b79b08df-8014-4efd-abed-..."]}[Data],
    DF = WS{[dataflowId="c1579a50-583a-4dc9-9d96-..."]}[Data],
    #"1TABLE" = DF{[entity="1TABLE]}[Data]
in
    #"1TABLE"

 

 

 

 

 

In PowerShell, I can do the following

Login-PowerBIServiceAccount

Get-PowerBIWorkspace

Get-PowerBIDataflow -WorkspaceId b79b08df-8014-4efd-abed-...

and get as output two dataflows I have in this workspace

 

 

 

 

 

Id           : c1579a50-583a-4dc9-9d96-...
Name         : ONE
Description  :
ModelUrl     :
ConfiguredBy : my.name@company.com

Id           : 380b63a3-15e4-4bc0-9d34-...
Name         : TWO
Description  :
ModelUrl     :
ConfiguredBy : my.name@company.com

 

 

 

 

 

but now, I don't see how to export

I see Export-PowerBIDataflow -WorkspaceId <xx> -Id <yy> -OutFile out.json can export a dataflow but I need to export at entity level as in Power Query above

 

Any idea if this is feasible and how to make it using PowerShell?

note: I know how to export from PowerBI Desktop using R script or to export from PowerBI using PowerAutomate visual (with limitations) but I need to pull data from external

 

Thanks for your help!

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @stchln ,

You can refer the following links to get it.

Powershell:

Power BI dataflows PowerShell scripts on GitHub

Description Module Name Download
Export all dataflows from a workspace ExportWorkspace.ps1 GitHub Location

REST API:

Dataflows - Get Dataflows

GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/dataflows

Best Regards

Community Support Team _ Rena
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

3 REPLIES 3
Hariharan_R
Solution Sage
Solution Sage

Hi @stchln 

As per my understanding, you can't export the data from Power bI dataflow. The available rest API is export the dataflow script and import which just holds the metadata of the dataflow.

 

We have REST api to export the data from Power BI dataset ("Execute DAX script"). if you create dataset using your dataflow then you can export the data.

Thanks

Hari

Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


My Blog :: YouTube Channel :: My Linkedin


v-yiruan-msft
Community Support
Community Support

Hi @stchln ,

You can refer the following links to get it.

Powershell:

Power BI dataflows PowerShell scripts on GitHub

Description Module Name Download
Export all dataflows from a workspace ExportWorkspace.ps1 GitHub Location

REST API:

Dataflows - Get Dataflows

GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/dataflows

Best Regards

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

Hello yingyinr

Looking at powerbi-powershell/examples/dataflows/ExportWorkspace.ps1

Exports all the dataflow model.json from a Power BI workspace into a folder

 

Meaning structure can be exported but not the raw data, right?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.