How to create a Data Issue Detector in Fabric Copilot
This tutorial shows how to create a Data Issue Detector in Fabric Copilot to automatically identify common issues (null values, incorrect formats, outliers) and generate reports or alerts. It is useful for monitoring data quality without writing much code and for speeding up the detection of failures before analyses or models.
Prerequisites
- Account with access to Microsoft Fabric and permissions to use Copilot in the workspace.
- A table or dataset in Fabric (for example in a Lakehouse or Warehouse) with sample data.
- Basic knowledge of Power Query / SQL and what nulls, outliers and formats are.
Step 1: Prepare the data source
Identify the table you want to analyze and confirm key columns (dates, IDs, numeric, text). If the table is in the Lakehouse, open it in Data Explorer; if it is in the Warehouse, use a simple query for sampling. The goal is to have a representative sample for Copilot to analyze.
-- Exemplo SQL para amostra no Warehouse
SELECT TOP 1000 *
FROM my_database.my_schema.my_table
ORDER BY some_date DESC;
Step 2: Open Copilot and create a new Prompt
Open Copilot in Fabric and create a new Prompt. Explain to Copilot the objective: detect nulls, invalid formats (for example emails), outliers and unexpected frequencies. Provide the data sample or connect directly to the table using the reference available in the environment.
Prompt exemplo:
"Analisa a tabela my_table e identifica:
- Colunas com >5% de valores nulos
- Valores com formato inválido (email, date)
- Outliers em colunas numéricas (usar IQR)
- Distribuições inesperadas (picos/valores únicos)
Fornece: resumo por coluna e queries SQL para isolar problemas."
Step 3: Adjust the Prompt for specific rules
Refine the Prompt for your business rules — for example, a phone field must have 9 digits, postal codes a specific pattern, or negative values are invalid. Specify thresholds (e.g. outliers outside 1.5*IQR) so Copilot generates reproducible results.
Adição ao Prompt:
"Regra: phone deve ser regex '^\d{9}$'.
Outlier: valor < Q1 - 1.5*IQR ou > Q3 + 1.5*IQR.
Reporta percentagem e exemplos de linhas."
Step 4: Run the suggested queries / actions
Copilot will propose SQL queries or steps in Power Query. Copy them and run them in the Warehouse or Dataflow as indicated. If Copilot suggests transformations, review them before applying in production.
Exemplo SQL gerado para nulos:
SELECT column_name, COUNT(*) AS total, SUM(CASE WHEN column_name IS NULL THEN 1 ELSE 0 END) AS null_count,
100.0 * SUM(CASE WHEN column_name IS NULL THEN 1 ELSE 0 END) / COUNT(*) AS null_pct
FROM my_database.my_schema.my_table
GROUP BY column_name;
Exemplo SQL para emails inválidos:
SELECT * FROM my_table WHERE NOT REGEXP_MATCH(email, '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$') LIMIT 50;
Step 5: Automate with a simple Prompt Chain
Create a Prompt Chain in Copilot that first runs null checks, then format checks and finally outliers, and that generates a consolidated report. This allows running the detector regularly without rewriting the Prompt each time.
Prompt Chain (exemplo lógico):
1) CheckNulls -> retorna colunas problemáticas
2) CheckFormats (usa output de 1) -> retorna exemplos por coluna
3) CheckOutliers -> retorna queries para investigação
4) Summarize -> cria relatório com recomendações
Verify the result
Confirm you have a per-column summary with percentages of nulls, examples of invalid formats, and lists of outliers. Run the generated queries and manually validate some rows. If you automated the Prompt Chain, run it again with another sample to ensure consistency.
Conclusion
With the Data Issue Detector in Fabric Copilot you can quickly identify data problems and get ready-to-run queries for investigation. Next steps: integrate this flow into a routine (scheduled) or into a Power Automate for alerts. Tip: start with small samples and test the regex/thresholds before applying to the whole table — which column do you want to monitor first?