Forum Discussion
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 :
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
4 Replies
- v-veshwara-msftCommunity 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 LearnHope this helps. Please reach out for further assistance.
Thank you.
- v-veshwara-msftCommunity Support
Hi Peter_MTG ,
Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out.
Thank you.
- Peter_MTGFrequent 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-msftCommunity Support
Hi Peter_MTG ,
Thanks for the follow-up.
In scenarios involving composite models, especially those with DirectQuery connections to Power BI datasets or Analysis Services models, there might be cases where TOM doesn't return all model metadata in PowerShell. While it can work with live connections and show tables and relationships in many cases, certain external or linked sources might still lead to limitations or unexpected behavior.
Tabular Editor can connect to the same XMLA endpoint but also integrates with the running Power BI Desktop session, which may allow it to access additional metadata, including from cached or session-specific content.
Agreed that TOM is very efficient for making multiple updates at once, and it would be helpful if it supported a wider range of model types.
You could consider submitting this as an idea in the Ideas Forum for broader visibility and also to find inputs from others who might have worked around similar limitations.