Forum Discussion
List of Datamarts using Cmdlets/REST API
- 1 year ago
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.
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,
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.