Data Refresh in Tabular Editor
- MK
- Mar 17, 2021
- 3 min read
Updated: Jun 21, 2022
***The scripts shown in this post have been updated to work in both Tabular Editor 2.x & Tabular Editor 3.
Tabular Editor offers so many inherent features which make it such an invaluable tool for developing tabular models. However, what makes it even better is the ability to write custom C# code using the Advanced Scripting window. This creates a plethora of possibilities only limited by the imagination. Many of my recent posts take advantage of this feature and this post is no exception.
As with all nifty advanced scripts, I recommend saving these scripts as Custom Actions so you can have easy access to them at any time.
Processing multiple tables
It has previously been shown how to refresh a table within Tabular Editor but we can take it a step further. The script below is able to process multiple tables - not just a single table. Naturally, it can also process a single table. Here's how it works:
Note: This requires Tabular Editor version 2.12.1 or higher and that you are connected live to an Analysis Services instance (File->Open->From DB...). This can also be a Power BI Premium dataset or if Tabular Editor is opened using the Power BI Desktop 'External Tools' option.
Within Tabular Editor, select the tables you want to process within the Table List.

2. Copy and paste the code below into the Advanced Scripting window (save it as a Custom Action).
#r "Microsoft.AnalysisServices.Core.dll"
using ToM = Microsoft.AnalysisServices.Tabular;
var refreshType = ToM.RefreshType.DataOnly;
ToM.SaveOptions so = new ToM.SaveOptions();
//so.MaxParallelism = 10;
foreach (var t in Selected.Tables)
{
string tableName = t.Name;
Model.Database.TOMDatabase.Model.Tables[tableName].RequestRefresh(refreshType);
}
Model.Database.TOMDatabase.Model.SaveChanges(so);
3. Update the refreshType parameter according to how you would like to process the tables. The options are documented here.
4. If you want to use the Sequence command to specify the Max Parallelism option, simply uncomment the 'so.MaxParallelism' line and specify the desired MaxParallelism value.
5. Click the play button (or press F5) to start the data refresh.
Processing multiple partitions
The only difference in processing partitions is that you select partitions. Otherwise, the instructions are the same as for processing tables. Just use the code below.
#r "Microsoft.AnalysisServices.Core.dll"
using ToM = Microsoft.AnalysisServices.Tabular;
var refreshType = ToM.RefreshType.DataOnly;
ToM.SaveOptions so = new ToM.SaveOptions();
//so.MaxParallelism = 10;
foreach (var p in Selected.Partitions)
{
string tableName = p.Table.Name;
string partitionName = p.Name;
Model.Database.TOMDatabase.Model.Tables[tableName].Partitions[partitionName].RequestRefresh(refreshType);
}
Model.Database.TOMDatabase.Model.SaveChanges(so);Processing the model
Processing the whole model is not recommended. However, recalculating the model is fine. Just these 4 lines of code are needed to do the job. Simply paste this code into the Advanced Scripting window and click play.
#r "Microsoft.AnalysisServices.Core.dll"
using ToM = Microsoft.AnalysisServices.Tabular;
var refreshType = ToM.RefreshType.Calculate;
Model.Database.TOMDatabase.Model.RequestRefresh(refreshType);
Model.Database.TOMDatabase.Model.SaveChanges();additional context
These scripts directly access the Tabular Object Model and actually do not generate TMSL (to which many of us are accustomed). The scripts (well, the RequestRefresh method) generate XML. TMSL is much cleaner and easier to read which is why it is used when scripting out code in this context. However, the TMSL gets translated into XML by the engine. Therefore, the scripts used in this post skip the TMSL part and feed XML directly to the server (since the engine does not care about code beautification). You can run a SQL Server profiler trace and see this for yourself. Actually, when you run TMSL you will also see the XML command (translated from TMSL) in the profiler trace. When you run a profiler trace against the scripts in this post you will only see the XML command.
Conclusion
It should be noted that processing large datasets within Tabular Editor is not recommended. This method is best for quickly processing relatively smaller datasets. Not to worry, I have a new tool coming out soon which offers a more robust solution for more complex processing scenarios. Stay tuned!

Wow! Such an amazing and helpful post this is. I really really love it. It’s so good and so awesome Gebetszeiten
This deep dive into data refresh in Tabular Editor is super useful — understanding how to efficiently update and manage your data models not only improves report accuracy, it saves time and reduces errors in analytics workflows. Tools and best practices that help us stay organized and predictable are critical in any tech environment. In the same spirit of optimizing how work gets done, using reliable workload software can help teams track responsibilities, balance tasks, and make sure everyone’s effort is aligned with project goals, which boosts overall efficiency and delivery.
Cuối tuần rảnh mình hay tìm game chơi nên cũng vào thử 28BET. Ban đầu mình chỉ vô xem thử thôi, nhưng thấy nhiều sảnh nên chơi luôn. Mình thử nổ hũ trước, quay cũng mượt, không bị đứng. Sau đó mình qua xổ số thì thấy hiển thị khá dễ hiểu. Có hôm mình chơi liên tục một lúc mà không gặp lỗi gì. Trong lúc mình trải nghiệm trên thì thấy hệ thống load nhanh, chuyển game cũng lẹ. Mình có thử nạp rút thì thấy xử lý khá nhanh. Với mình thì kiểu này hợp để vào chơi lúc rảnh
Mình hay online buổi tối nên cũng thử SV66 xem sao. Lúc đầu vào thì thấy giao diện khá đơn giản, không phải mò nhiều. Mình thử thể thao trước, thấy đặt kèo cũng dễ, không bị rối. Sau đó mình chuyển qua casino chơi vài ván thì thấy mượt, không bị lag. Có hôm mình chơi khá lâu mà không gặp lỗi gì. Trong lúc mình vào thì thấy game cũng nhiều nên không bị chán nhanh. Thỉnh thoảng mình thấy có ưu đãi 88K hiện lên, nhìn cũng nhẹ nhàng. Mình chơi không nhiều, chỉ lúc rảnh nên thấy vậy là ổn rồi.
https://sv66art.anime-report.com/
Mình biết đến nền tảng này qua bạn bè, ban đầu chỉ vào xem thử cho biết thôi. Lướt một lúc thì thấy cũng có khá nhiều trò, từ đá gà đến mấy game bắn cá nên ngồi thử vài ván cho vui. Giao diện nhìn không quá rối, chuyển qua lại giữa các mục cũng khá nhanh. Trong lúc đang xem thì mình có mở S8 để tìm hiểu thêm, thấy cách sắp xếp khá rõ ràng nên dễ theo dõi. Chơi một lúc thì thấy mọi thứ vận hành ổn, không bị gián đoạn nên trải nghiệm cũng khá thoải mái, phù hợp để giải trí lúc rảnh.
https://s8ink.anime-navi.net/