Power BI TMDL View: Benefits, Security Risks & Best Practices
Microsoft’s effort with the Power BI Project format and the introduction of the Tabular Model Definition Language has been, and will continue to be, a game-changer for how we build semantic models. Recently, Microsoft released TMDL View in Power BI Desktop as a preview feature. I’ve been using this awesome feature to do things I couldn’t easily do in the past, such as:
Take a snapshot of the schema – TMDL View lets you save a version of your code in a tab. If you’re experimenting with a change, this is a great way to quickly revert back if needed.
Find and Replace – Do you hate that you can’t search your Power Query in the Advanced Editor window? Well, when you script out the table in TMDL View, you can do just that.
Share Code – This has made pushing functions to models easier, and I’ve seen many forums on the Internet sharing TMDL scripts to accelerate work.
A Word of Caution
I’d like to caution you, though, about bringing TMDL scripts from the Internet into your own environment. TMDL scripts are code and should be treated as untrusted when they come from external sources. If you come from the Excel world, you’ll see the correlation between TMDL scripts and macro scripts.
In this recent article on SimpleTalk, I cover how you can protect your models (and data) when incorporating outside TMDL scripts.
I also posted a video on how, for free, using Power Query Lint, you can check for potential issues in a TMDL script before bringing it into your environment.
Note: This doesn’t mean you should avoid using TMDL View, but rather that you should be aware of the power it can wield, both positively and negatively.
As always, I’d love to hear your feedback on the article or video. Share your thoughts with me on LinkedIn or Twitter/X.