OLE DB or ODBC error: Exception from HRESULT: 0x80040E57

If you’re having “OLE DB or ODBC error: Exception from HRESULT: 0x80040E57.“ error during refreshes, there is a solution.

First of all, it’s always best to narrow issue down to specific step in your Power Query transformations.

In my case issue was happening for custom columns added. However, whenever I was refreshing preview - it wouldn't occur. Only during application of changes it would fail.

As the next step, I went to google the error code itself - HRESULT: 0x80040E57.

Arithmetic overflow error converting expression to data type int.“ documentation stated.

Here's something that might surprise you: I've heard from more than a few developers that Currency data type has more precision. Contrary to that belief, Currency data type in Power BI doesn't actually provide more precision than other numeric types. In fact, it has fixed precision and can handle fewer digits than Decimal.

💡 Key differences:
𝗖𝘂𝗿𝗿𝗲𝗻𝗰𝘆 𝘁𝘆𝗽𝗲:
• Range: -922 trillion to +922 trillion
• Fixed 4 decimal places
• Uses 8 bytes of storage

𝗗𝗲𝗰𝗶𝗺𝗮𝗹 𝘁𝘆𝗽𝗲:
• Can handle numbers approximately 100 billion times larger than Currency type
• Up to 28-29 significant digits
• Uses 16 bytes of storage

💡 To put this in perspective:
If Currency type can handle amounts up to about 922 trillion, Decimal type can work with numbers in the septillions (that's a trillion trillions).

⚠️ 𝗜𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁 𝗗𝗔𝗫 𝗖𝗼𝗻𝘀𝗶𝗱𝗲𝗿𝗮𝘁𝗶𝗼𝗻:
Using Currency type affects ALL calculations in your measures. Every mathematical operation will be performed with reduced precision, which can lead to cumulative rounding errors in complex calculations.
It has it's uses, but should me used mindfully taking into account reduced precision.

Now, in my case "Arithmetic overflow error" was an issue in the calculation itself, generating huge numbers, combined with Currency data type. However, it's important to know the difference.

Previous
Previous

Festive Animated Background for Your Power BI Reports

Next
Next

Globe Particle Cloud iN Power BI using Deneb and Vega-Lite