- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Powershell : Tabular Object Model, model object is null
I sometimes use PowerShell to quickly alter a set of similar measures in a Power BI dataset. This could be done with this code :
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices.Tabular")
$serverName = "localhost:xxxxx";
$databaseName = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
$svr = New-Object Microsoft.AnalysisServices.Tabular.Server
$svr.Connect($serverName)
$db = $svr.databases.GetByName($databaseName)
$findstring="find string"
$replacestring="replace string"
foreach($table in $db.Model.Tables) {
foreach($measureobj in $table.measures) {
$measureobj.expression=$measureobj.Expression.replace($findstring,$replacestring)
}
}
#$db.Model.SaveChanges()
Works great, until recently I found some reports where the Model-attribute of the database seems to be empty.
Although it works perfectly fine in PowerBI, I can't find the model anymore in PowerShell. Also Tabular and DAX Studio are working fine with the reports dataset.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw that in the report one of the datasources was still using the Power BI dataflows (Legacy) connector. As soon as I switched this one to the Power BI dataflows connector, the model attribute was correctly filled in.
I'm not 100 % using this connector always causes this problem, but at least in this case, replacing it solved the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw that in the report one of the datasources was still using the Power BI dataflows (Legacy) connector. As soon as I switched this one to the Power BI dataflows connector, the model attribute was correctly filled in.
I'm not 100 % using this connector always causes this problem, but at least in this case, replacing it solved the issue.

Helpful resources
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.
Power BI Monthly Update - June 2025
Check out the June 2025 Power BI update to learn about new features.

User | Count |
---|---|
11 | |
6 | |
6 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
3 |