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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
RichardCooper
New Member

List of Datamarts using Cmdlets/REST API

Hello,

 

With the demise of Datamarts in the next few months I've been tasked with identifying how many we have across our Organization. Is there an easy way to use either the Power BI Cmdlets in Powershell or the REST API to do this? I'm fairly new to Power BI/Fabric administration so any help would be most appreciated.

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Hi. The Fabric Administrators (the ones with that specific rol in EntraID) can see a Admin Workspace at the Fabric Portal. That one has three reports. One of them is Purview Hub there is a page for Item Explorer at the whole tenant. You can filter by item type and check whatever you want.

ibarrau_0-1753364065116.png

As far as I remember the Power Bi Rest API doesn't have datamart as item to explore. The Fabric Rest API has added the datamarts to list them as admin but it can be trickier to work on that code than opening this.

I hope that helps,


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

Happy to help!

LaDataWeb Blog

View solution in original post

6 REPLIES 6
ibarrau
Super User
Super User

Hi. The Fabric Administrators (the ones with that specific rol in EntraID) can see a Admin Workspace at the Fabric Portal. That one has three reports. One of them is Purview Hub there is a page for Item Explorer at the whole tenant. You can filter by item type and check whatever you want.

ibarrau_0-1753364065116.png

As far as I remember the Power Bi Rest API doesn't have datamart as item to explore. The Fabric Rest API has added the datamarts to list them as admin but it can be trickier to work on that code than opening this.

I hope that helps,


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

Happy to help!

LaDataWeb Blog

Hi

Thank you very much for this. It was very helpful for me to quickly get the answer I needed.

rohit1991
Super User
Super User

Hi @RichardCooper ,

 

The easiest way is definitely PowerShell (no coding required), but the REST API works too if you want to automate further.

 

PowerShell Method (Quick & Admin-Friendly):

  1. Install the Power BI PowerShell module (if you don’t already have it): Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser

  2. Sign in to your Power BI tenant: Connect-PowerBIServiceAccount

  3. Get all Datamarts you have access to and export as CSV: Get-PowerBIDatamart -All | Export-Csv -Path "DatamartsList.csv" -NoTypeInformation

REST API Method (Best for Automation/Developers):a

To get a full list, you actually need to:

So it’s a two-step loop, there’s no single API call that returns all Datamarts in every workspace at once.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Thank you very much for you're reply, it's certainly given me something to look at, but the answer I accepted got me to the immediate answer I needed.

v-kpoloju-msft
Community Support
Community Support

Hi @RichardCooper,

Thank you for posting your query in Microsoft Fabric Community Forum.

There are two ways you can do this, depending on what you are comfortable with.

You can use Power BI PowerShell Cmdlets or the Admin REST API to retrieve all Datamart’s:

If you are okay using PowerShell, you can run a quick script that checks all your workspaces and lists out anything that’s a Datamart.

Here’s a basic example:

Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser

Import-Module MicrosoftPowerBIMgmt

Login-PowerBI



$workspaces = Get-PowerBIWorkspace -All



foreach ($ws in $workspaces) {

    $datasets = Get-PowerBIDataset -WorkspaceId $ws.Id

    foreach ($ds in $datasets) {

        if ($ds.DatasetType -eq "Datamart") {

            Write-Output "$($ds.Name) in workspace $($ws.Name)"

        }

    }

}

This will give you a list of all DataMart’s and which workspace they belong to.

If you are a Power BI Service Admin and have access to tools like Postman or use scripting, you can call the following API to get a full list:

GET https://api.powerbi.com/v1.0/myorg/admin/datamarts

This returns detailed info like Datamart name, workspace ID, created date, and more.

Official API doc for reference: Items - List Datamarts - REST API (Datamart) | Microsoft Learn

 

Also, refer to the below mentioned documentation links for better understanding:
Power BI Cmdlets reference | Microsoft Learn
Introduction to DataMart’s - Power BI | Microsoft Learn

Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

Thank you for using the Microsoft Community Forum.

Thank you very much for you're reply, it's certainly given me something to look at, but the answer I accepted got me to the immediate answer I needed.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors