Brisbane, 4000 QLD

+61 4 3836 7017

If you are still copy-pasting comments from Databricks Unity Catalog into Power BI you need to stop scrolling and read this post.

I have been working with Databricks lately and have been impressed by how modern the interface is, everything is accessible via a web browser (as opposed to using SSMS for Azure). You have data lineage, ability to share queries, and most importantly there is a catalog of every table and views where you get an overview of the artifacts, sample data, history etc.

One thing that got my attention was the ability to add comments to table/view columns in the catalog. Now if you are importing these views into your Power BI semantic model, you would want to import the column comments into the descriptions of the Power BI columns. There is no native way to achieve this in Power BI. Here comes the ‘information_schema’ to the rescue.

In the ‘information_schema’ there is metadata listed for all the tables and views in the catalog. The comments on each column is also listed. So how do we get this inside Power BI.

Let’s explore 3 options

1. Copy-paste. It’s 2025 AD, not 2025 BC, so this is a BIG NO.

2. Run a SQL query on the ‘information_schema’ and export the relevant fields (view name, column name, comments) into a csv and use Tabular Editor to import the comments into the description property for each column.

Not a bad idea, except that it is still a manual process to run the query and save it as a csv. You might be able to automate the export (havent tried it though), but you still have to deal with a csv file which you have to manage.

3. Use a C# script in Tabular Editor to import the comments into the description property of the columns in your semantic model. This can be part of the build process. Now we are talking. So how do we do this.

Import the relevant fields from the ‘information_schema’ into your semantic model as a separate table. You will also need a mapping table to map the view name from Databricks to the table name in Power BI.

Run the script below and you are done ! That’s it ! With a bit of once off set up work in your semantic model you can now import comments from views in Databricks into your enterprise models !

Share this