diff --git a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
index e74f646307d337a14639eed8cec5dd333781c9bb..616315fd2462c4f23663cf97b77b925ba540e710 100644
--- a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
@@ -145,8 +145,12 @@ export function SpendingGraph({
             : b,
         ).months[lastMonth][balanceTypeOp];
   const maxYAxis = selectionMax > thisMonthMax;
-  const dataMax = Math.max(...data.intervalData.map(i => i[balanceTypeOp]));
-  const dataMin = Math.min(...data.intervalData.map(i => i[balanceTypeOp]));
+  const dataMax = Math.max(
+    ...data.intervalData.map(i => i.months[thisMonth].cumulative),
+  );
+  const dataMin = Math.min(
+    ...data.intervalData.map(i => i.months[thisMonth].cumulative),
+  );
 
   const tickFormatter = tick => {
     if (!privacyMode) return `${amountToCurrencyNoDecimal(tick)}`; // Formats the tick values as strings with commas
@@ -154,18 +158,16 @@ export function SpendingGraph({
   };
 
   const gradientOffset = () => {
-    if (dataMax <= 0) {
+    if (!dataMax || dataMax <= 0) {
       return 0;
     }
-    if (dataMin >= 0) {
+    if (!dataMin || dataMin >= 0) {
       return 1;
     }
 
     return dataMax / (dataMax - dataMin);
   };
 
-  const off = gradientOffset();
-
   const getVal = (obj, month) => {
     if (month === 'average') {
       return obj[month] && -1 * obj[month];
@@ -246,7 +248,7 @@ export function SpendingGraph({
                     y2="1"
                   >
                     <stop
-                      offset={off}
+                      offset={gradientOffset()}
                       stopColor={theme.reportsGreen}
                       stopOpacity={0.2}
                     />
@@ -259,7 +261,7 @@ export function SpendingGraph({
                     y2="1"
                   >
                     <stop
-                      offset={off}
+                      offset={gradientOffset()}
                       stopColor={theme.reportsGreen}
                       stopOpacity={1}
                     />
diff --git a/upcoming-release-notes/2745.md b/upcoming-release-notes/2745.md
new file mode 100644
index 0000000000000000000000000000000000000000..7898425d7666cd0207d42cafd640e056cc8954d4
--- /dev/null
+++ b/upcoming-release-notes/2745.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [carkom]
+---
+
+Fixes a NaN error in spending report.