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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Peter_MTG
Frequent Visitor

Connect to Tabular Object Model using Powershell => empty model object

When I open a composite model using TOM in Powershell, the model object is empty. I use the following code which works fine :

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices.Tabular")
$serverName = "localhost:59041";
$databaseName = "415492b0-1830-4386-893b-ccc2a3936f55";

$svr = New-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect($serverName)
$db = $svr.databases.GetByName($databaseName)
 
When I look at the $db object the model seems to be empty. I believe I have this issue only when the model is a composite model, with a live connection the model (and tables, relationships, ...) are filled in. Is this a limitation of TOM or am I missing something here ?
 
Parent : BEGENTW3ZVDBY3\AnalysisServicesWorkspace_f5030a56-b197-415a-8465-c165da44abb7
IsInTransaction : False
Model :
Server : BEGENTW3ZVDBY3\AnalysisServicesWorkspace_f5030a56-b197-415a-8465-c165da44abb7
DismissedValidationRules : {}
DismissedValidationResults : {}
LastUpdate : 11/07/2025 9:17:10
Visible : True
Language : 1033
Collation :
Translations : {}
ReadWriteMode : ReadWrite
DbStorageLocation :
ImagePath :
ImageUniqueID :
ImageVersion :
ImageUrl :
StorageEngineUsed : TabularMetadata
ModelType : Tabular
3 REPLIES 3
Peter_MTG
Frequent Visitor

Hi @v-veshwara-msft ,

 

Thanks for your answer. I think I have to conclude that TOM can't be used when dealing with a composite model. I always wonder myself how a tool like Tabular Editor does this then. It's a bit of a shame, because TOM is so helpful to quickly do some changes using Powershell.

v-veshwara-msft
Community Support
Community Support

Hi @Peter_MTG ,

Thanks for posting in Microsoft Fabric Community and sharing the script and explanation.

This might be related to how TOM interacts with composite models that include remote sources using DirectQuery, such as Power BI datasets, Analysis Services models.

In such cases, the $db.object may appear empty, as TOM typically surfaces only the metadata that's locally defined in the model. Tables and relationships from remote sources might not be accessible through this method.

 

You had shared a similar scenario earlier where changing from the Power BI Dataflows (Legacy) connector resolved the issue, which could suggest that certain connectors or model configurations affect how TOM sees the model.

 

Please go through these links for more details:
Programming Power BI semantic models with the Tabular Object Model (TOM) | Microsoft Learn

Semantic model connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft...

 

Hope this helps. Please reach out for further assistance.

Thank you.

Hi @Peter_MTG ,
Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out.
Thank you.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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