This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi All,
Kindly help on the code for updating the M expression code with .net for SSAS Tabular model.
Scenario:
we have table with partition and we have to update the partition query using .net
we have code to replace the existing M Expression with New one ,unfortunately the changes are not updating in Database LEVEL .(SSAS Tabular) .May be i missed any syntax of the .net code.
Please see below code and help out in this.
TOA.Partition partition = m.Tables.Find(Table).Partitions[1];
OverrideCollection oc = new OverrideCollection
{
Partitions =
{
new PartitionOverride
{
OriginalObject =partition,
Source = new MPartitionSourceOverride
{
Expression=expressions
}
}
}
};
var listOc = new List<OverrideCollection>();
listOc.Add(oc);
partition.RequestRefresh(TOA.RefreshType.Add, listOc);
// m.Tables[Table].Partitions[1].Refresh(TOA.RefreshType.Full, listOc); //it is not working
db.Update(UpdateOptions.ExpandFull);
db.Model.SaveChanges();
m.SaveChanges();
TOA.Partition partition1 = m.Tables.Find(Table).Partitions[1];
Thanks,
Santhosh
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |