Measure drift: detecting when a client has hand-edited your DAX
A client fixes a measure directly in their model, and your next deployment silently overwrites it. How to detect that drift before it does damage.
Posted by
BilâlRelated reading
Premium, PPU, or Fabric capacity: what to enable before automating Power BI
Power BI Pro isn't enough to create or modify measures through an API. The one hard requirement: a capacity with the XMLA read/write endpoint enabled.
The scenario that hurts
You deploy a measure to a client. A few weeks later, someone on the client side — an analyst, another consultant — fixes that measure directly in Power BI Desktop, because an edge case wasn't handled. The report looks fine. Then you redeploy a template update, with no idea the measure was ever touched, and you overwrite the fix. The bug comes back, and nobody knows why.
What we mean by drift
Drift is simply a gap between the DAX expression actually present in the client's model and the one you last deployed. It can be harmless (a legitimate fix) or dangerous (a change that breaks something else). Either way, the risk isn't the edit itself — it's overwriting it without knowing.
How to detect it
The principle is direct: compare, measure by measure, the expression actually deployed at the client to the one you yourself pushed last.
Expected (deployed by you)
DIVIDE([margin],[total_revenue],0)
Actual (modified client-side)
DIVIDE([margin],[total_revenue])*100If the two expressions differ, that's drift. This comparison can run on demand, before a deployment, or automatically on a recurring basis so you get alerted without having to think about it.
The right response: never overwrite silently
Once drift is detected, the affected measure shouldn't be overwritten by default on the next deployment. The corresponding checkbox should start unchecked in the preview — it's your call, after seeing the diff, whether to take back control or keep the client's modified version. It's the same principle as a preview before every push: nothing gets written until you've seen it, and confirmed it.