Dynamics 365 Data Quality Framework: The IT Architect's Playbook

Every six months, the same conversation happens in boardrooms across Hyderabad, Mumbai, and Bangalore. A CTO walks into a quarterly review, pulls up the CRM dashboard, and asks why the sales pipeline numbers don't match what the field team is reporting. The answer is almost always the same: dirty data. Duplicate Accounts, Contacts with no email addresses, Leads that haven't been touched in 14 months — all quietly poisoning every report, every forecast, and every customer interaction downstream.

Most organisations respond with a point-in-time data cleanup project. They hire a consultant, run a deduplication exercise, write a few Excel macros, and declare victory. Three months later, the problem is back. Why? Because they treated the symptom, not the disease. What they needed — and what this post will give you — is a systemic Dynamics 365 data quality framework built across three disciplined layers: Prevention, Detection, and Remediation.

This is not a post about why data quality matters. You already know that. This is a technical playbook for IT Architects and IT Managers who need a repeatable, operationalisable system that survives staff turnover, system upgrades, and business growth.

Why Point-in-Time Initiatives Always Fail

Before we build the framework, we need to understand the failure mode. Point-in-time data quality projects fail because they operate outside the system rather than inside it. They clean what exists today but install no mechanism to prevent the same patterns from recurring tomorrow.

Consider these three common Dynamics 365 entity problems that illustrate the gap:

A one-time cleanup addresses each of these — once. A framework prevents the Account duplicate from being created, detects the incomplete Contact the moment it enters the system, and flags the stale Lead before it becomes a reporting liability. That is the difference between reactive and systemic.

Layer 1: Prevention — Enforcing Quality at Ingestion

The most cost-effective data quality investment is the one that stops bad data from entering Dataverse in the first place. Prevention is not a single control — it is a stack of complementary mechanisms, each covering a different ingestion vector.

Dataverse Duplicate Detection Rules

Duplicate detection rules in Dataverse are often configured once during implementation and then forgotten. For a mature framework, they need to be treated as governed solution components — version-controlled, environment-specific, and reviewed quarterly.

For the Account entity, configure rules that match on a combination of fields rather than a single field. A name-only match will generate too many false positives. A recommended rule for Accounts matches on:

Critically, ensure your duplicate detection rules are activated for both interactive creation and data import jobs. Many organisations activate rules for UI creation but leave the import pathway unprotected — which is precisely where bulk data quality problems originate.

Mandatory Field Policies Beyond "Business Required"

Dynamics 365's native "Business Required" field constraint is a UI-layer control. It can be bypassed by API integrations, Power Automate flows, and legacy connector imports. For a genuine prevention layer, you need server-side enforcement.

Use Dataverse plug-ins registered on the Pre-Validation stage of the Create and Update messages to enforce field completeness rules that cannot be bypassed regardless of the ingestion channel. A lightweight plug-in on the Contact entity that throws an InvalidPluginExecutionException when both Email and MobilePhone are null will enforce data quality across every integration, every connector, and every API call — not just the user interface.

// Plug-in: Enforce Contact Communication Field
public void Execute(IServiceProvider serviceProvider)
{
    var context = (IPluginExecutionContext)
        serviceProvider.GetService(typeof(IPluginExecutionContext));

    if (context.InputParameters.Contains("Target") &&
        context.InputParameters["Target"] is Entity entity)
    {
        var email = entity.GetAttributeValue<string>("emailaddress1");
        var mobile = entity.GetAttributeValue<string>("mobilephone");

        if (string.IsNullOrWhiteSpace(email) &&
            string.IsNullOrWhiteSpace(mobile))
        {
            throw new InvalidPluginExecutionException(
                "Contact must have at least one communication field: " +
                "Email or Mobile Phone.");
        }
    }
}

Power Automate Pre-Validation Flows

For scenarios where a plug-in is too rigid — for example, when you want to warn a user rather than hard-block a record — use Power Automate flows triggered on record creation to run pre-validation logic and surface actionable notifications. A flow triggered when a Lead is created can check for missing Industry, Lead Source, and Rating fields, then post a Teams adaptive card to the record owner with a direct deep-link back to the Lead form for immediate remediation. This creates a "soft enforcement" layer that drives completeness without generating friction for legitimate exceptions.

ALM-Governed Solution Components

Prevention controls only work if they survive deployment cycles. All duplicate detection rules, plug-in assemblies, and validation flows must be packaged as managed solution components and deployed through a documented ALM pipeline (Dev → Test → UAT → Production). Unmanaged components in production are a governance risk — they can be accidentally deleted, modified, or deactivated without traceability. Use Azure DevOps pipelines with the Power Platform Build Tools to enforce this discipline across every environment.

Layer 2: Detection — Your Power BI Data Quality Dashboard

Prevention reduces the rate of bad data entering the system. Detection ensures that what slips through — or what already exists — is visible, measured, and assigned to an owner. The vehicle for this is a dedicated Power BI data quality dashboard connected directly to Dataverse via the Power BI Dataverse connector.

The Three Core Metrics

Your dashboard should surface three fundamental data quality dimensions for each entity and each business unit:

DAX Measure Templates

The following DAX measures provide a starting point for building these metrics in Power BI. These assume you have imported the relevant Dataverse entity tables into your Power BI model.

-- Completeness Score for Contact (Email + Mobile)
Contact Completeness % =
DIVIDE(
    COUNTROWS(
        FILTER(
            Contact,
            NOT(ISBLANK(Contact[emailaddress1])) &&
            NOT(ISBLANK(Contact[mobilephone]))
        )
    ),
    COUNTROWS(Contact),
    0
)

-- Stale Lead Ratio (No modification in 90 days)
Stale Lead Ratio % =
DIVIDE(
    COUNTROWS(
        FILTER(
            Lead,
            Lead[statecode] = 0 &&
            DATEDIFF(Lead[modifiedon], TODAY(), DAY) > 90
        )
    ),
    COUNTROWS(FILTER(Lead, Lead[statecode] = 0)),
    0
)

Publish this dashboard to a dedicated Power BI workspace and configure a daily scheduled refresh. Share it with IT Managers, CRM Administrators, and business unit heads. Visibility creates accountability — and accountability drives behaviour change faster than any policy document.

Layer 3: Remediation — Automated Correction at Scale

Detection without remediation is just a more sophisticated way of watching problems accumulate. The remediation layer closes the loop by providing both automated correction for rule-based issues and bulk update patterns for historical data debt.

Automated Correction Workflows in Power Automate

Not all data quality issues require human intervention. For rule-based corrections — such as standardising phone number formats, enriching missing fields from related records, or auto-disqualifying Leads that have been open beyond a threshold — Power Automate cloud flows provide a scalable, low-code remediation mechanism.

Build a scheduled remediation flow that runs nightly using the Dataverse "List rows" action with a filter query to identify records meeting specific stale or incomplete criteria. For each record returned, apply a deterministic correction and log the action to a custom "Data Quality Remediation Log" entity for audit traceability. This log entity is also your evidence base for quarterly governance reviews.

Bulk Update Patterns via Web API

For large-scale historical remediation — think 50,000 Contact records with missing territory assignments — Power Automate loops are too slow and risk hitting API throttling limits. The right tool here is the Dataverse Web API batch endpoint, which allows you to bundle multiple operations into a single HTTP request.

POST https://[org].crm.dynamics.com/api/data/v9.2/$batch
Content-Type: multipart/mixed; boundary=batch_remediate
OData-MaxVersion: 4.0
OData-Version: 4.0

--batch_remediate
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH https://[org].crm.dynamics.com/api/data/v9.2/contacts([guid])
Content-Type: application/json

{
  "new_territory": "South India",
  "new_dq_remediated": true
}
--batch_remediate--

Execute batch requests from an Azure Function on a scheduled trigger, processing records in batches of 100 (the Dataverse recommended maximum per batch). This pattern can remediate tens of thousands of records overnight without impacting system performance during business hours.

The Quarterly Governance Cadence Model

Technology without process reverts to entropy. IT Managers need a repeatable governance cadence that keeps the framework operational and evolving. We recommend the following quarterly rhythm:

Building a Framework That Outlasts Any Single Project

The organisations that win on data quality are not the ones that run the biggest cleanup projects — they are the ones that make data quality structural. When prevention controls are embedded in managed solutions, detection metrics are visible to every stakeholder in Power BI, remediation is automated for rule-based issues, and governance runs on a quarterly clock, data quality stops being a project and starts being a capability.

This Dynamics 365 data quality framework is designed to be implemented incrementally. Start with the detection layer — get your Power BI dashboard live within two weeks and establish your baseline metrics. Then layer in prevention controls over the following month, prioritising the entities with the highest duplicate and incompleteness rates. Introduce automated remediation in the third month once you have enough detection data to write reliable correction rules.

At CRMONCE, we work with IT teams across India to architect and implement exactly this kind of systemic, layered approach to Dynamics 365 data governance. Whether you are starting from scratch or trying to salvage a CRM that has accumulated years of data debt, the framework above gives you a starting point that is grounded in how Dataverse, Power Automate, and Power BI actually work together — not how a marketing brochure says they should.

If you are ready to move from reactive cleanup to proactive governance, let's build your data quality framework together. Reach out to the CRMONCE team for a complimentary architecture review of your current Dynamics 365 environment.