⚠️ Power BI Troubleshooting

Power BI OLE DB or ODBC Error: The Real Fix for Every Variant

Five different messages get lumped under “OLE DB or ODBC error” — and each one has a different actual cause. Here’s the fix for each, not a generic “check your connection” answer.

The Direct Answer

“OLE DB or ODBC error” isn’t one bug — it’s an umbrella Power BI throws over five genuinely different failures. 0x80040E4E is usually a bad relationship or corrupted query step. 0x80040E1D is almost always a data-format mismatch, most often a date field. [Expression.Error] couldn’t fold means a transformation step can’t run on the source server. [DataFormat.Error] Unspecified error usually hides a bad row inside a merge or append. “The key didn’t match any rows” means a join is looking for a value that no longer exists in the source. Fix them differently — they are not the same problem.

Six years running — this error has been actively reported in Power BI community threads from 2020 through 2026, across every version
It’s almost never Power BI itself — in nearly every case I found, the root cause was the data, the model, or the query steps, not a product bug
Refresh history first — the popup error message is a symptom; refresh history tells you which step actually failed
Rebuilding beats guessing — deleting and manually re-adding a corrupted query step fixes it more often than any setting change does
🩺

Diagnose Your Exact Error

Pick the message you’re actually seeing — the fix is different for each one.

Likely Cause

    Your specific fix steps will appear here once you select an error above.

    Power BI OLE DB or ODBC Error: Why It’s Really Five Different Problems

    Power BI reuses this wrapper message for almost any failure that happens while a query is talking to a data source, regardless of what actually broke underneath. That’s why searching the exact phrase “OLE DB or ODBC error” turns up wildly different advice — half of it won’t apply to your case.

    The part that actually matters is what comes after that phrase — the HRESULT code, or the bracketed error type. That’s your real diagnosis. Treat the two as completely separate errors, because they are.

    0x80040E4E: Relationship and Query-Step Corruption

    Exception from HRESULT: 0x80040E4E

    What’s actually happening

    This is a generic OLE DB provider failure, which sounds unhelpful — but in practice it clusters around four specific causes, in order of how often they turn out to be it:

    Most Likely Causes, Ranked
    1. A relationship has a blank or corrupted “related record.” Filter your data to find rows where the related-record lookup is blank, and fix or exclude them — several practitioners report this clearing the error immediately.
    2. A relationship is set to many-to-many when it should be many-to-one. Check cardinality on every relationship touching the failing table.
    3. The Power Query step chain is corrupted — usually from pasting M code directly into the Advanced Editor instead of building steps through the UI. Delete the table and manually rebuild the applied steps one at a time rather than re-pasting the old code.
    4. A network-layer mismatch — disable IPv6 on the machine running the refresh, and confirm TLS 1.2 is enforced. This is a real fix for some cases, but check it last — it resolves the error less often than the first three.

    0x80040E1D: Data-Format Drift, Usually Dates

    Exception from HRESULT: 0x80040E1D

    What’s actually happening

    This code shows up when a source field’s format changes underneath a query that was built expecting the old format — the classic case is a date field shifting from 2019/9/9 to 2019-9-9, or a column name picking up a special character after a source-side update.

    Fix
    1. Don’t just change the data type on the existing column — create a new, explicitly-typed column instead, and point downstream steps at the new one. Changing type in place on a drifted column frequently fails to fully resolve the mismatch.
    2. Check the source column name for special characters that weren’t there before — a source-side rename or schema update is a common trigger.
    3. If this started after a source system upgrade, check whether the source’s own date/locale settings changed — this is more common after ERP or CRM platform updates than people expect.

    “We Couldn’t Fold the Expression to the Data Source”

    [Expression.Error] We couldn’t fold the expression to the data source

    What’s actually happening

    Power BI normally pushes your Power Query transformations down to run on the source database itself — this is called query folding, and it’s what makes DirectQuery fast. When a step you’ve added can’t be translated into the source’s native query language, folding breaks. In Import mode this just slows things down; in DirectQuery mode, it fails outright, which is what you’re seeing.

    Fix
    1. Right-click each applied step in order and check whether “View Native Query” is available. The first step where it grays out is exactly where folding broke — everything before it is fine.
    2. Move whatever transformation broke folding to after the point where you no longer need DirectQuery-level performance, or push it into a view on the source side instead of doing it in Power Query.
    3. This is especially common with Snowflake and other cloud warehouses in DirectQuery mode — certain M functions (custom columns with complex logic, some text functions) simply have no equivalent the source engine understands.

    “DataFormat.Error: Unspecified Error”

    [DataFormat.Error] Unspecified error

    What’s actually happening

    This message is deliberately vague, and that’s the tell — it almost always means a bad row or a type mismatch is hiding inside a merge or append step, most commonly when you’re combining tables from two different source systems that don’t share exactly the same schema.

    Fix
    1. Remove your merge or append steps one at a time, refreshing after each removal, until the error disappears — that tells you exactly which source table is introducing the conflict.
    2. Once isolated, check that table’s column types against the other side of the merge. A single column typed as text on one side and number on the other is enough to trigger this.
    3. If the conflict is in an append (stacking tables rather than joining them), check for a schema change in just one of the source tables — new column, renamed column, or a type change upstream.

    “The Key Didn’t Match Any Rows in the Table”

    [Expression Error] The key didn’t match any rows in the table

    What’s actually happening

    This fires during a merge (join) step when a value in your key column no longer exists in the table you’re joining against. It’s rarely a Power BI problem — it’s almost always that the source data changed after the query was originally built.

    Fix
    1. Confirm the merge kind actually matches what you intend — Inner Join will throw exactly this kind of failure where Left Outer Join would just return blanks instead.
    2. Check the key column on both sides for null or blank values — a join can’t resolve a blank against anything.
    3. If this started recently with no query changes on your end, assume the source data changed — a deleted record, a renamed ID, or a reloaded dimension table upstream.

    The General Troubleshooting Order That Actually Works

    Microsoft’s own refresh troubleshooting documentation is worth reading alongside this guide — it covers capacity-throttling and node-level errors that sit outside the five OLE DB/ODBC variants here, and the two guides complement each other rather than overlap.

    ✅ Work Through It In This Order

    1. Check refresh history before touching anything. The popup is a summary; refresh history in the Power BI service tells you which specific step and table actually failed.
    2. Reproduce it in Power BI Desktop first. If it only fails in the service but works in Desktop, the problem is gateway or credentials, not your query logic — a completely different fix path than everything above.
    3. Isolate by removing steps, not by guessing. Strip the query back toward the Source step and refresh after each removal. Whichever step reintroduces the error is your actual cause.
    4. Only then apply the error-specific fix from the sections above, once you know which of the five you’re actually dealing with.

    ⚠️ Don’t jump straight to reinstalling Power BI or clearing your entire credential cache. Both show up constantly as “fixes” in forum threads, and both occasionally work — by accident, because they reset something unrelated. Neither addresses any of the five root causes above, so if the underlying data or query problem is still there, the error comes back the next time the source changes.

    Quick Reference Table

    ErrorMost Common CauseFirst Thing to Check
    0x80040E4ERelationship or query-step corruptionBlank related-record values
    0x80040E1DDate/data-format drift at the sourceRebuild the date column fresh
    Couldn’t fold the expressionUnsupported transformation in DirectQueryView Native Query per step
    DataFormat.Error: UnspecifiedBad row hidden in a merge/appendRemove merge steps one at a time
    Key didn’t match any rowsSource data changed since query was builtCheck for nulls in the key column

    Frequently Asked Questions

    What causes OLE DB or ODBC error: Exception from HRESULT 0x80040E4E in Power BI?
    This code is a generic OLE DB provider-level failure, and in practice it traces to one of four things: a corrupted or blank value in a relationship’s related-record field, a relationship accidentally set to many-to-many instead of many-to-one, a Power Query step chain that got corrupted (often from pasting code directly into the Advanced Editor), or a network-layer mismatch involving IPv6 or an outdated TLS version. Check relationships and blank keys first — that resolves it more often than the network settings do.
    What causes OLE DB or ODBC error: Exception from HRESULT 0x80040E1D in Power BI?
    This variant is almost always a data-format mismatch introduced by a source change, most commonly a date field switching formats or a column name picking up special characters after a source update. Rebuilding the affected column as a new, explicitly-typed column rather than changing the type in place resolves it in most reported cases.
    What does “We couldn’t fold the expression to the data source” mean in Power BI?
    This is a query folding failure. Power BI normally pushes your transformations down to the source database to run there; a step you’ve added can’t be translated into the source’s native query language, so folding breaks — and that fails outright in DirectQuery mode. Right-click each step and check whether “View Native Query” is available — the first step where it grays out is where folding broke.
    What does “DataFormat.Error: Unspecified error” mean in Power BI?
    This message is intentionally vague and usually masks a type mismatch or a bad row hiding inside a merge or append step, most commonly when combining tables from two different source systems with inconsistent schemas. The fastest path to the real cause is removing merge or append steps one at a time and refreshing after each removal.
    What does “The key didn’t match any rows in the table” mean in Power BI?
    This happens during a merge or join step when a value in your key column doesn’t exist in the table you’re joining against — usually because the source data changed after the query was built, or the key column contains nulls the join can’t resolve. Confirm the merge kind matches what you intend, and check for blank values in the key column.
    Is OLE DB or ODBC error a Power BI bug or a data problem?
    In the overwhelming majority of reported cases, it’s a data or configuration problem, not a Power BI bug — a corrupted step chain, a schema change at the source, a bad relationship, or a blank key value. Genuine Power BI-side bugs tied to this message are rare enough that they shouldn’t be your first assumption.

    How This Guide Was Built

    Root causes and fixes are drawn from Microsoft’s own official refresh-troubleshooting documentation, cross-referenced against real, dated threads on the Microsoft Fabric Community forum (2020–2026) where practitioners diagnosed and resolved each specific variant, plus independent 2025–2026 troubleshooting write-ups. Fixes are ranked by how frequently they’re reported to resolve the issue, not by which is technically simplest to write about.

    Written and verified by A.J., Data Engineering Researcher · Ultimate Info Guide

    Disclaimer: This guide reflects our best verification as of July 2026 and is not affiliated with or endorsed by Microsoft. Error behavior can vary by Power BI version, gateway configuration, and data source. If none of the fixes above resolve your case, check Power BI’s refresh history for the specific failing step and consider filing a support ticket with that detail attached.
    Scroll to Top