Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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.
Solved! Go to Solution.
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,
Happy to help!
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,
Happy to help!
Hi
Thank you very much for this. It was very helpful for me to quickly get the answer I needed.
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):
Install the Power BI PowerShell module (if you don’t already have it): Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser
REST API Method (Best for Automation/Developers):a
To get a full list, you actually need to:
List all workspaces:
GET https://api.powerbi.com/v1.0/myorg/groups
For each workspace, get the Datamarts:
GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datamarts
So it’s a two-step loop, there’s no single API call that returns all Datamarts in every workspace at once.
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.
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.