Refactor if condition
diff --git a/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py b/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py
index d69b4308..20385a7 100644
--- a/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py
+++ b/sdks/python/apache_beam/testing/load_tests/load_test_metrics_utils.py
@@ -745,9 +745,9 @@
                not is_streaming_pipeline) else MEM_PER_GB_HR_STREAMING
 
   # Additional costs for streaming or shuffle data
-  if is_streaming_pipeline:
-    cost += dataflow_service_metrics.get(
-        "TotalStreamingDataProcessed") * SHUFFLE_PER_GB_STREAMING
+  cost += dataflow_service_metrics.get(
+      "TotalStreamingDataProcessed"
+  ) * SHUFFLE_PER_GB_STREAMING if is_streaming_pipeline else 0
 
   cost += dataflow_service_metrics.get(
       "TotalShuffleDataProcessed"