Forum Discussion
Increment Refresh
- 1 year ago
Hi Jyaul1122 ,
The error message "Database consistency checks (DBCC) failed while checking the column statistics." indicates that Power BI’s internal tabular model (used in the dataset) encountered corruption or inconsistency during processing.
Please check below things to fix the issue.
1. Stabilize Schema Before Refresh, Check that all files have consistent column structures. If headers vary, use a standardized schema mapping before promoting headers.
Please try below M code.
let
Source = Master,
FilteredTable = Table.SelectRows(Source, each ([Column6] = "Profit")),
PromotedHeaders = Table.PromoteHeaders(FilteredTable, [PromoteAllScalars=true]),
StandardizedColumns = Table.RenameColumns(PromotedHeaders, {
{Table.ColumnNames(PromotedHeaders){0}, "Date Increment"},
{Table.ColumnNames(PromotedHeaders){1}, "Project"},
{Table.ColumnNames(PromotedHeaders){2}, "Sub Project"},
{Table.ColumnNames(PromotedHeaders){3}, "Profit"}
}),
ChangedTypes = Table.TransformColumnTypes(StandardizedColumns, {
{"Date Increment", type datetime},
{"Project", type text},
{"Sub Project", type text},
{"Profit", Int64.Type}
}),
FilteredIncrement = Table.SelectRows(ChangedTypes, each [Date Increment] >= RangeStart and [Date Increment] < RangeEnd)
in
FilteredIncrement
2. Before publishing, load all files locally in Power BI Desktop and check No missing columns, No null headers and No type mismatches.3. If you have intermediate queries like Master or Transform File, disable load for them to reduce memory pressure and avoid schema conflicts.
4. Sometimes, the dataset in the service gets corrupted, Delete the dataset from Power BI Service and Re-publish the report from Power BI Desktop and Reconfigure incremental refresh.
5. While dynamic indexing (Table.ColumnNames(){1}) works during development, it can break in service. Prefer static column names after schema stabilization.
6. You can create a function to normalize schema across files before combining. Please refer below M code.(TableToNormalize as table) =>
let
Renamed = Table.RenameColumns(TableToNormalize, {
{Table.ColumnNames(TableToNormalize){0}, "Date Increment"},
{Table.ColumnNames(TableToNormalize){1}, "Project"},
{Table.ColumnNames(TableToNormalize){2}, "Sub Project"},
{Table.ColumnNames(TableToNormalize){3}, "Profit"}
}),
Typed = Table.TransformColumnTypes(Renamed, {
{"Date Increment", type datetime},
{"Project", type text},
{"Sub Project", type text},
{"Profit", Int64.Type}
})
in
Typed
Note: Then apply this function to each file before combining.I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
More data example:
File Name: 2025-07-17
| Type | ||||||
| Table | Table | |||||
| Project | Project | Field | ||||
| P7 | Project | Row | ||||
| P8 | Project | Row | ||||
| Type | ||||||
| Table | Table | |||||
| Project | Sub Project | Profit | Profit | Field | ||
| P7 | P71 | 8 | Profit | Row | ||
| P8 | P81 | 9 | Profit | Row | ||
| Type | ||||||
| Table | Table | |||||
| Project | Sub Project | Location | Loss | Loss | Field | |
| P7 | P71 | L8 | 10 | Loss | Row | |
| P8 | P81 | L8 | 11 | Loss | Row |
File Name: 2025-07-24
| Type | ||||||
| Table | Table | |||||
| Project | Project | Field | ||||
| P9 | Project | Row | ||||
| P10 | Project | Row | ||||
| Type | ||||||
| Table | Table | |||||
| Project | Sub Project | Profit | Profit | Field | ||
| P9 | P91 | 10 | Profit | Row | ||
| P10 | P101 | 11 | Profit | Row | ||
| Type | ||||||
| Table | Table | |||||
| Project | Sub Project | Location | Loss | Loss | Field | |
| P9 | P91 | L9 | 5 | Loss | Row | |
| P10 | P101 | L9 | 3 | Loss | Row |
Hi Jyaul1122 ,
Thank you for reaching out to the Microsoft Community Forum.
Please Check below things.
1. Promoted Headers steps assumes column positions that may change or not during service refresh.
2. Project column might be renamed conditionally or exist only in certain files.
3. Column headers like "Project", "sub Projects" and "profit" are derived dynamically from file, so they don't exist until after filtering and transforming.
4. Incremental refresh tries to fold the query to the source, but dynamic header logic can break query folding and trigger this error.
Please avoid direct column references like "Project" before prompting headers and use column position reference or rename safely.
Please replace your Profit query with below query.
let
Source = Master,
FilteredTable = Table.SelectRows(Source, each ([Column6] = "Profit")),
PromotedHeaders = Table.PromoteHeaders(FilteredTable, [PromoteAllScalars=true]),
RenamedColumns = Table.RenameColumns(
PromotedHeaders,
{
{Table.ColumnNames(PromotedHeaders){0}, "Date Increment"},
{Table.ColumnNames(PromotedHeaders){1}, "Project"},
{Table.ColumnNames(PromotedHeaders){2}, "Sub Project"},
{Table.ColumnNames(PromotedHeaders){3}, "Profit"}
}
),
ChangedTypes = Table.TransformColumnTypes(RenamedColumns, {
{"Date Increment", type datetime},
{"Project", type text},
{"Sub Project", type text},
{"Profit", Int64.Type}
}),
FilteredIncrement = Table.SelectRows(ChangedTypes, each [Date Increment] >= RangeStart and [Date Increment] < RangeEnd)
in
FilteredIncrement
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
- v-dineshya1 year agoCommunity Support
Hi Jyaul1122 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
- Jyaul11221 year agoHelper III
I tried your idea, when I run with my actual data, I got different error than previous.
I do not know, what it is mean ?
- v-dineshya1 year agoCommunity Support
Hi Jyaul1122 ,
The error message "Database consistency checks (DBCC) failed while checking the column statistics." indicates that Power BI’s internal tabular model (used in the dataset) encountered corruption or inconsistency during processing.
Please check below things to fix the issue.
1. Stabilize Schema Before Refresh, Check that all files have consistent column structures. If headers vary, use a standardized schema mapping before promoting headers.
Please try below M code.
let
Source = Master,
FilteredTable = Table.SelectRows(Source, each ([Column6] = "Profit")),
PromotedHeaders = Table.PromoteHeaders(FilteredTable, [PromoteAllScalars=true]),
StandardizedColumns = Table.RenameColumns(PromotedHeaders, {
{Table.ColumnNames(PromotedHeaders){0}, "Date Increment"},
{Table.ColumnNames(PromotedHeaders){1}, "Project"},
{Table.ColumnNames(PromotedHeaders){2}, "Sub Project"},
{Table.ColumnNames(PromotedHeaders){3}, "Profit"}
}),
ChangedTypes = Table.TransformColumnTypes(StandardizedColumns, {
{"Date Increment", type datetime},
{"Project", type text},
{"Sub Project", type text},
{"Profit", Int64.Type}
}),
FilteredIncrement = Table.SelectRows(ChangedTypes, each [Date Increment] >= RangeStart and [Date Increment] < RangeEnd)
in
FilteredIncrement
2. Before publishing, load all files locally in Power BI Desktop and check No missing columns, No null headers and No type mismatches.3. If you have intermediate queries like Master or Transform File, disable load for them to reduce memory pressure and avoid schema conflicts.
4. Sometimes, the dataset in the service gets corrupted, Delete the dataset from Power BI Service and Re-publish the report from Power BI Desktop and Reconfigure incremental refresh.
5. While dynamic indexing (Table.ColumnNames(){1}) works during development, it can break in service. Prefer static column names after schema stabilization.
6. You can create a function to normalize schema across files before combining. Please refer below M code.(TableToNormalize as table) =>
let
Renamed = Table.RenameColumns(TableToNormalize, {
{Table.ColumnNames(TableToNormalize){0}, "Date Increment"},
{Table.ColumnNames(TableToNormalize){1}, "Project"},
{Table.ColumnNames(TableToNormalize){2}, "Sub Project"},
{Table.ColumnNames(TableToNormalize){3}, "Profit"}
}),
Typed = Table.TransformColumnTypes(Renamed, {
{"Date Increment", type datetime},
{"Project", type text},
{"Sub Project", type text},
{"Profit", Int64.Type}
})
in
Typed
Note: Then apply this function to each file before combining.I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh