Finding
We Built a Tool to Find Unused Measures. Then the Platform Kept Shrinking It.
Big semantic models don't get cleaned up. They get added to.
A measure for one report. Another for a one-off request. A copy someone made "just to test." A year later, nobody can say which ones still matter, and nobody wants to delete the wrong one.
That's where we were. So I set out to answer one question: what in this model is actually used?
The first answer was a workaround
There was no clean way to ask the model. So I built one.
A small web app: upload the model, upload the reports connected to it, and the code digs through the files to work out what each report touches. Used on one side, unused on the other.
We ran it once a quarter. Each time, it found hundreds of measures nothing was using, and we cleaned them out.
It worked. But the hard part was never the logic. It was getting at the information, locked inside files that were never meant to be read, and collected by hand every quarter.
Then the platform started doing the work
When we moved to PBIP, the files opened up. The model and reports were plain text now, so there was nothing to dig through. The code just read the folder.
When the project went into Git, even the folder came to us. No uploads, no collecting files from people. The code read the repo, and the answer was always current.
Every step, I wrote less code than the step before. And cleanup stopped being a quarterly event.
Now the question answers itself
Today the model's metadata and every report's definition land in a database on their own: every measure, every report, and where each one is used.
"Is this measure used?" isn't a tool we run anymore. It's a question we query, any time.
The question never changed. The work to answer it kept disappearing.
What's next
Measures were the start. Now we're turning the same question on unused tables and columns, which is where the real size savings are.
What I take from this
- Build the workaround. It teaches you exactly what the platform is missing.
- When the platform catches up, let your code shrink. That's progress, not loss.
- Metadata in a table turns cleanup from a project into a query.