Dyota's blog

Power BI: Guard against deletion

Previously, I wrote about a PowerShell script that I wrote so that I can check dependencies of Power BI measures and tables in my model and reports, before I delete anything (you can read that here).

When speaking to colleagues, I've discovered that there are other techniques that can be employed to guard against accidentally deleting tables or measures.

Move measures off data tables

I've seen this done in two ways:

  1. Have an empty table that houses all of your measures
  2. Mirror your data table using a calculated table (or maybe SELECTCOLUMNS() all the columns you need).

The idea with both of these is that, in the event that you delete your source data table, your measures (and for 2., your calculated columns) will not be deleted along with it.

This of course does not guard against deleting the actualy measures themselves, and shooting yourself in the foot that way (i.e. deleting a measure that one of your visuals needs).

Also for 2., there is a memory cost to mirroring your tables. This is not recommended for large data sets in import mode.