fix: Query Condition On Billing date filters
diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py
index da44325..092baa4 100644
--- a/erpnext/controllers/trends.py
+++ b/erpnext/controllers/trends.py
@@ -140,6 +140,8 @@
 
 	if trans in ['Purchase Receipt', 'Delivery Note', 'Purchase Invoice', 'Sales Invoice']:
 		trans_date = 'posting_date'
+		if filters.period_based_on:
+			trans_date = filters.period_based_on
 	else:
 		trans_date = 'transaction_date'