top of page

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.


  1. 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!

33 Comments



janesimth
7 days ago

https://www.linkedin.com/posts/realesaletter-com_esa-esaletter-emotionalsupportanimal-activity-7345417491524820993-peN_/

https://peda.net/p/NathanDrake/blogs/blogs/what-forms-are-required-to-qualify-for-an-esa-letter-at-real

https://doc.clickup.com/90181407002/d/2kzkp48u-558/what-is-text-humanizerorgand-how-does-it-work

https://sites.google.com/view/freeessaywriter-ai/AI-Essay-Writer

https://coda.io/@harry-wilson/myessaywriter-ai

https://www.slideshare.net/realesaletterofficia

https://www.scribd.com/user/879416022/RealESALetter-com

https://www.issuewire.com/real-esa-letter-ranked-among-the-most-legit-esa-services-for-mental-health-support-1836534594909822

https://differ.blog/p/what-s-the-cost-of-an-esa-letter-from-realesaletter-com-190846

https://forum.trackandfieldnews.com/special/albums/1908528-best-ai-essay-writer-here-s-what-i-found-2025-update

https://ziuma.com/Thread-Best-AI-Essay-Writer-Tools-in-2025-%E2%80%93-Ranked-with-Ratings

https://medium.com/@lisabrowns/what-is-an-esa-letter-and-why-i-chose-realesaletter-com-c81923632127

https://www.findit.com/gljjiwonhqkrdrd/RightNow/what-are-the-legal-protections-that-come-with-an-esa/cc277ec7-dc90-4e53-9d81-c2fc8661a176

https://x.com/zackjerry3/status/1942161132317270242

https://x.com/zackjerry3/status/1942161377373618329

https://www.reddit.com/r/UserReview/comments/1ltrha4/best_esa_letter_in_utah/

https://usefulinsights.hashnode.dev/best-place-to-buy-furniture-online-in-pakistan-heres-why-shopkollekt-leads-the-way

https://medium.com/@alvincurry/can-i-use-my-california-esa-letter-if-i-move-to-another-state-a4dd78cc42e6

https://www.reddit.com/r/Mommit/comments/1lvatrq/can_a_landlord_deny_an_esa_in_california/

https://usefulinsights.hashnode.dev/write-like-a-pro-with-the-help-of-myessaywriterai

https://johnbrown.hashnode.dev/is-perfectessaywriterai-a-good-choice-we-checked-it-out

https://differ.blog/p/why-perfectessaywriter-ai-is-the-1-ai-essay-tool-for-academic-writing-fe15e9

https://freeessaywriterai.umso.co/blog/freeessaywriter-ai-write-your-essays-without-paying-a-dime

https://getfoureyes.com/s/1O5mn/

https://www.reddit.com/r/Pets/comments/1lw6ajp/best_esa_letter_certification/

https://www.quora.com/What-websites-out-there-provide-legit-ESA-letters

https://freeessaywriterai.hashnode.dev/how-freeessaywriterai-became-the-1-choice-for-students-worldwide

Like

Sleepy Bearzz
Sleepy Bearzz
7 days ago

DVTOTO

Slot Gacor

Slot Gacor

Situs Toto

penuh dengan kejutan unik dan menarik yang di lengkapi dengan game paling gacor!

Like


janesimth
Jun 17

https://blogs.bangboxonline.com/posts/why-students-like-using-myessaywriterai-for-school-work

https://www.justcast.com/shows/daily-tips/audioposts/674112

https://nas.io/nathandrake/challenges/what-texthumanizer-org-does-and-how-it-helps-you

https://leasedadspace.com/members/NathanDrake/blog/1503006/best-bar-stools-for-your-home-or-business-at-shopkollekt.com

https://www.justcast.com/shows/daily-tips/audioposts/674404

https://nas.io/nathandrake/challenges/what-makes-myessaywriter-ai-a-top-choice-for-academic-writing

https://daily-news.document360.io/docs/using-perfectessaywriterai-to-polish-your-essays-like-a-pro

https://leasedadspace.com/members/NathanDrake/blog/1503013/freeessaywriter.ai-for-academic-success-without-a-subscription

https://blogs.bangboxonline.com/posts/what-makes-freeessaywriterai-a-top-choice-for-academic-writing

https://nathandrake.federatedjournals.com/avoiding-detection-how-texthumanizer-org-makes-ai-text-undetectable/

https://dailyupdates.bcz.com/2025/06/10/is-perfectessaywriter-ai-a-good-choice/

https://imageevent.com/dailynews/writeessaysfreewithfreeessaywriterai

http://blogs.bangboxonline.com/posts/why-people-use-texthumanizerorg-to-improve-their-writing

https://nas.io/nathandrake/challenges/is-freeessaywriter-ai-really-free-heres-what-you-get

https://dailyupdates.bcz.com/2025/06/11/why-content-creators-trust-texthumanizer-org-to-bypass-ai-filters/

https://www.justcast.com/shows/daily-tips/audioposts/675915

https://imageevent.com/dailynews/3millionstudentstrustmyessaywritera

https://dailynews.umso.co/blog/perfectessaywriter-ai-best-academic-writing-tool

https://dailyupdates.bcz.com/2025/06/12/how-freeessaywriter-ai-became-the-1-choice-for-students-worldwide/

https://dailynews.umso.co/blog/texthumanizer-ai-undetectable-original-content

https://imageevent.com/dailynews/bestcoasterscollectioninshopkollekt

https://www.wikiwand.com/es/articles/MyEssayWriter

https://imageevent.com/dailynews/howperfectessaywriteraihelpsstudents

https://dailynews.umso.co/blog/is-freeessaywriter-ai-safe-to-use-what-you-should-know

https://leasedadspace.com/members/NathanDrake/blog/1503122/texthumanizer.org-%E2%80%93-makes-ai-writing-sound-more-human

https://imranhaiders.medium.com/why-more-people-are-shopping-at-shopkollekt-com-024014942a18

https://medium.com/@cindythomas080/best-ai-text-humanizer-6408aa4fcab2

https://www.wikiwand.com/es/articles/MyEssayWriter

https://www.wikiwand.com/es/articles/RealEsaLetter.com

https://243064429.hs-sites-na2.com/blog/why-students-like-using-myessaywriter.ai-for-school-work

https://blogs.bangboxonline.com/posts/why-perfectessaywriterai-is-the-most-trusted-ai-writing-platform-for-students

https://dailyupdates.bcz.com/2025/06/17/reviewing-myessaywriter-ai-smart-ai-help-for-smarter-writing/

https://www.justcast.com/shows/daily-updates/audioposts/677221

https://imageevent.com/dailynews/texthumanizerorgthebesttooltomake

https://en.everybodywiki.com/CollegeEssay.org_and_the_Path_to_Academic_Success

https://www.sharepresentation.com/NathanDrake/realesalettercom-fastest-legit-esa-letter-online

https://essay-s-school.thinkific.com/pages/test-your-content-with-myaidetector-org-ai-or-human

Like

©2021 by Elegant BI

bottom of page