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!

153 Comments


The msc meaning focuses on the transition from a generalist perspective to a specialist authority in a chosen field. This shift is vital for anyone looking to stand out in a saturated labor market. UniCCM provides various guides on how a Master of Science can help individuals pivot their careers into entirely new industries.

Like

Kurlon
Kurlon
Dec 25, 2025

When I started using Shikshade I noticed how much easier exam prep becomes when everything is organized in one place. Browsing through notes, opening PDFs, and checking updated exam details helped me catch things I would have missed on my own. Simple features like clear syllabus pages or quick access to previous papers save a lot of time and make studying feel less scattered.


Like

alexis smith
alexis smith
Dec 23, 2025

Handling construction risks effectively requires knowledge of groundworkers insurance. The College of Contract Management offers courses focused on practical outcomes. Learners gain confidence in managing site liabilities. Many have reduced stress when dealing with incidents.

Like

janesimth
Nov 05, 2025

https://x.com/RowanMirelle/status/1973284777576034464/photo/1

https://rowanmirelle.blogspot.com/2025/10/avoid-pet-fees-this-october-secure-your.html

https://www.pinterest.com/pin/921971354977839398

https://www.instagram.com/p/DPTVS20Ebj1/

https://esa962.wordpress.com/2025/10/03/how-a-psd-letter-can-simplify-housing-travel-or-employment-october-2025-guide-by-realesaletter-com/

https://www.cake.me/portfolios/esa-laws-by-state-a-pet-owner-s-guide

https://www.pinterest.com/pin/921971354977867489

https://www.instagram.com/p/DPVh28_kYg-/

https://x.com/RowanMirelle/status/1973998739556544810

https://www.notebook.ai/documents/1940651

https://www.pinterest.com/pin/921971354977975899

https://www.instagram.com/p/DPdPiSZkUeY/

https://build.opensuse.org/users/RowanMirelle

https://wakelet.com/@RowanMirelle20011

https://gitea.bubbletea.dev/rowanmirelle-source

https://www.ganjingworld.com/news/1i0k63ad0sb7kxKXyducRLXp012q1c

https://ceo.ca/@Rowan-Mirelle/esa-letter-for-your-dog-made-easy-october-2025-update-by-realesalettercom

https://esaletter.hashnode.dev/how-an-esa-letter-for-housing-can-secure-your-rental-approval-october-2025-realesalettercom

https://rowanmirelle.b12sites.com/expert-tips-for-fast-psd-letter-approval

https://www.youtube.com/@RowanMirelle/posts

https://www.youtube.com/@RowanMirelle/posts

https://www.mymeetbook.com/rowanmirelle

https://paperpage.in/blogs/7172/Can-My-Doctor-Write-an-ESA-Letter-Explained-by-Experts

https://github.com/rowanmirelle-source

https://aminoapps.com/c/ask-blogs/page/blog/how-to-get-your-dog-legally-recognized-with-an-esa-letter-october-2025-realesaletter-com/77r2_zdtPu5rL138V67PNQ5G0vBlPn4z8n

https://www.buzzfeed.com/rowan_mirelle/avoid-scams-and-get-a-verified-esa-letter-online

https://ceo.ca/@Rowan-Mirelle/navigating-new-yorks-esa-laws-my-personal-journey-to-getting-a-legit-emotional-support-animal-letter

https://multichoicetalentfactory.com/user/79021

https://www.jotform.com/app/rowanmirelle/montana-emotional-support-animal-la

https://minecraftcommand.science/profile/rowanmirelle

https://myenglishclub.com/members/rowanmirelle

https://vimeo.com/rowanmirelle

https://guides.co/g/rowanmirelle-california-esa-rules-unpacked-what-every-resident-needs-to?ajs_event=Referred

https://www.sociomix.com/c/wellness/psd-letter-for-pets-legal-rights-and-landlord-responsibilities-realesaletter-com-october/1761121510

https://justpaste.me/BUhW4

https://www.tumblr.com/rowanmirelle/798103983570993152/protect-your-esa-rights-indiana-legal-support

https://www.chiguu.com/discussions/how-to-get-your-dog-legally-recognized-with-an-esa-letter-%E2%80%93-october-2025-realesaletter-com

https://www.ganjingworld.com/news/1i2lqr0a0gj17qi3xFX9tfXVQ1n21c

https://events.scenethink.com/oklahoma-emotional-support-animal-laws-2026-rights-rules-and-renewals-nov-4-2025

Like

janesimth
Nov 05, 2025

https://hackernoon.com/u/zaylincrestwell

https://www.blogger.com/profile/11970744721258691724

https://zaylincrestwell.blogspot.com/2025/09/how-emotional-support-animals-help.html

https://medium.com/@zaylincrestwell/is-realesaletter-com-a-legitimate-source-for-esa-letters-what-you-need-to-know-298a792cd9d3

https://zaylincrestwell.nicepage.io/blog/everything-you-need-to-know-about-getting-a-legit-esa-letter-online-in-2025.html

https://zaylincrestwell.blogspot.com/2025/09/how-i-registered-my-dog-as-emotional.html

https://sites.google.com/view/zaylincrestwell/zaylin-crestwell/the-complete-2025-guide-to-emotional-support-animal-letters-what-every-pet?authuser=1

https://zenwriting.net/zaylin-crestwell/h1-emotional-support-animals-esas-improve-your-mental-well-being-in-93vt

https://www.cake.me/portfolios/top-7-ways-esas-dogs-cats-reduce-stress

https://writeupcafe.com/2025-guide--how-emotional-support-animals-improve-your-life

https://www.ganjingworld.com/news/1hvel9p4o055NuX0x02eo77ME1ns1c

https://ceo.ca/@zaylincrestwell/how-esa-letters-improve-mental-health-housing-in-2025

https://medium.com/@zaylincrestwell/esa-letter-housing-rules-in-georgia-06e5589950aa

https://www.cyberpinoy.net/read-blog/282218_how-to-renew-your-esa-letter-a-step-by-step-guide.html

https://medium.com/@zaylincrestwell/esa-letters-vs-service-animal-letters-key-differences-explained-b3977940b578

https://medium.com/@zaylincrestwell/my-journey-with-emotional-support-animals-letter-91992b02bb01

https://writeupcafe.com/best-esa-letter-services-for-cats-in-2025

https://medium.com/@zaylincrestwell/the-everyday-comfort-of-an-esa-letter-de6b025ab6b8

https://kumu.io/zaylincrestwell/realesalettercom-a-personal-path-to-peace-october-2025

https://medium.com/@zaylincrestwell/october-2025-guide-esa-letters-for-everyday-life-367793ef9277

https://taplink.cc/realesaletter.com

https://qiita.com/realesaletterofficial

https://www.skool.com/@realesaletter-com-4777

https://opencollective.com/realesaletter-com1

https://mez.ink/realesaletterofficial

https://www.f6s.com/member/realesaletter.com

https://zaylincrestwell.wordpress.com/2025/10/01/%f0%9f%90%be-esa-letter-renewal-in-washington-dc-october-2025/

https://www.waivio.com/@waivio_zaylin-crestwell/6uj5a1-esa-letter-renewal-october-update

https://zaylin.federatedjournals.com/october-2025-esa-letter-renewal-in-new-york/

https://gitea.com/zaylincrestwell/-/projects/7859

https://october-2025-psychology-of-esa-letters.hashnode.dev/october-2025-psychology-of-esa-letters

https://www.friendbookmark.com/blogpost/66684/protect-housing-and-travel-rights-with-esa-mdash-why-renewal-matters

https://legacystories.org/storyboard/entry/from-anxiety-to-peace-october-2025-esa-letter-journey

https://sumo.app/forum/community/is-online-esa-renewal-safe-in-oct-2025-realesaletter-explains

https://www.cyberpinoy.net/read-blog/284722_how-can-you-spot-esa-letter-scams-in-october-2025-realesaletter-com-s-expert-gui.html

https://www.easyfie.com/read-blog/2401768_what-are-the-latest-esa-housing-law-updates-in-florida-for-october-2025-realesalettercom-explains

https://zaylin-crestwell.b12sites.com/How-to-Spot-a-Fake-ESA-Letter-Online-in-October-2025

https://medium.com/@zaylincrestwell/why-realesaletter-com-is-the-1-trusted-esa-letter-service-in-october-2025-a684738e38fb

https://wanderlog.com/view/ayzdgzlnpe/how-fake-esa-letters-hurt-real-owners--october-2025/shared

https://www.bondhuplus.com/read-blog/257696_can-landlords-deny-emotional-support-animals-october-2025-guide.html#google_vignette

https://froodl.com/what-did-i-learn-after-one-year-with-my-esa-letter-from-realesaletter-com

https://zaylincrestwell.alboompro.com/post/can-you-renew-an-esa-letter-online-in-october-2025-without-hassle?post_editing=true

https://community.wongcw.com/blogs/1165392/How-Does-the-Fair-Housing-Act-Protect-ESA-Owners-in

https://ivebo.co.uk/read-blog/182938

https://quicknote.io/aa910920-aa76-11f0-b0af-77ff986ea736

https://beacons.ai/zaylincrestwell

https://beacons.ai/realesaletter.com

https://disqus.com/by/zaylincrestwell/about/

https://www.divephotoguide.com/user/zaylincrestwell

https://www.krop.com/zaylincrestwell/#/

https://zaylincrestwell.onepage.website/

https://www.jotform.com/app/252931784121456

https://locals.com/_/feed?mode=profile&username=zaylincrestwell

https://hashnode.com/@zaylincrestwell

https://justpaste.me/Bnxr2

https://vimeo.com/zaylincrestwell

https://guides.co/g/where-can-you-get-a-trusted-esa-letter-in-minnesota-for-20/671730

https://payrchat.com/blogs/32191/whats-the-legal-way-to-get-an-esa-letter-in-new-hampshire-2025

https://www.tumblr.com/zaylincrestwell/798175816302395392/how-can-you-secure-a-valid-esa-letter-in?source=share

https://www.sociomix.com/c/wellness/where-can-you-find-a-legit-esa-letter-in-montana-this-october-2025/1761202801

https://doc.clickup.com/9017339845/d/8cqkby5-637/howto-apply-onlinefora-certified-esa-letterin-coloradofor-202526

https://gitlab.anptic.gov.bf/zaylincrestwell/how-to-renew-your-esa-letter/issues/4

https://type.ai/published/uNfIMGdcQU

https://wanderlog.com/view/gawvtiwkkk/esa-letter-requirements-in-2026-what-every-pet-owner-should-know

https://blogs.bangboxonline.com/posts/can-you-legally-qualify-for-an-esa-letter-in-virginia-this-october-2025

https://hallbook.com.br/blogs/786659/Easiest-Way-to-Get-a-Legitimate-ESA-Letter-in-Mississippi

https://posteezy.com/how-can-emotional-support-animal-letter-protect-you-legally-2026-realesalettercom-4

https://zatylincrestwell.tistory.com/2

https://www.are.na/block/40690420

https://paperpage.in/blogs/20551/What-Does-a-Legit-ESA-Letter-in-South-Dakota-Include

https://colab.research.google.com/drive/1gSDAA1RIeSumTgvNpVLzZUZEfXgsIese?usp=sharing

https://pad.itiv.kit.edu/s/FCTw4bvDM

https://devpost.com/software/how-to-obtain-a-valid-esa-letter-in-oregon-for-2026

https://www.chiguu.com/discussions/how-realesaletter-com-helps-you-get-a-legal-esa-letter-in-west-virginia-for-2026-housing

https://zaylincrestwell.gitbook.io/zaylincrestwell-docs/

https://differ.blog/p/why-realesaletter-com-is-rated-1-on-sitejabber-in-2025-e5343c

https://issuu.com/zaylincrestwell/docs/get_your_certified_esa_letter_vermont_2026_with_re/s/131523292

https://www.novypro.com/article/esa-letter-missouri-2026-for-housing--psd-support-%E2%80%93-realesalettercoms-official-guide?Popup=memberProfile&Data=1759822762762x846167095156166100

https://matters.town/a/6x6f9amwv2hm

https://www.chiguu.com/discussions/esa-letter-indiana-2026-%E2%80%93-realesaletter-com%E2%80%99s-step-by-step-housing-psd-approval-guide

https://wakelet.com/wake/4cuylpNV60gsFwvztlkgg

https://raovatonline.org/rao-vat/how-an-esa-letter-helped-me-cope-with-postpartum-anxiety-in-florida/

https://payrchat.com/blogs/33911/real-esa-letter-made-it-easy-for-me-to-keep-my-esa-rabbit-in-family-housing

https://drukarnia.com.ua/articles/i-got-my-esa-letter-for-my-parrot-and-it-changed-my-entire-family-s-routine-niLGV

https://guestboard.co/events/alexis-cox/details#show-features

https://x9iawvj2sg3pnsfi.umso.co/

https://www.promoteproject.com/article/202484/realesalettercom-approved-my-case-quickly-and-i-finally-found-emotional-peace

https://youengage.me/v/6909921523f90b0100033556

https://www.notebook.ai/documents/2032874

https://natalierogers.craftingstore.net/

https://events.scenethink.com/real-esa-letter-helped-me-keep-my-emotional-support-cat-in-my-apartment-nov-3-2025-2-00pm

https://paragraph.com/@derek-thompson/real-esa-letter-made-me-believe-in-emotional-support-animals-again

https://issuu.com/brittanyross/docs/adam_rivera.docx/s/132681210

https://matters.town/a/uxpvxpxdyf1x

https://bulkwp.com/support-forums/users/finnbernays/

https://www.britishartclub.co.uk/profile/finnbernays

https://.heylink.me/finnbernays./

https://sciter.com/forums/users/finnbernays/

https://gravatar.com/finnbernays

Like

©2021 by Elegant BI

bottom of page