Forum Discussion
Too slow performance in querying in each
- 1 year ago
I am still trying to reduce the performance time and one of my efforts was to separate the calculation logic of weekend and public holidays from queries and it reduced the time to run so far.
I am not sure why but after I separated the calculation logic to a function and calling that from queries, performance has been enhanced.
Outstanding = Table.AddColumn(_decided, "DaysUntilToday", each ( if [Lodged_date] = null then 0 else ( fx_calBusinessDays(DateTime.Date([Lodged_date]), _toDate) ) ) ),When I tested with the original code with fully implemented 25 queries, it runs about / more than 2 hours but now it runs about an hour. Thanks.
I am still trying to reduce the performance time and one of my efforts was to separate the calculation logic of weekend and public holidays from queries and it reduced the time to run so far.
I am not sure why but after I separated the calculation logic to a function and calling that from queries, performance has been enhanced.
Outstanding = Table.AddColumn(_decided, "DaysUntilToday",
each (
if [Lodged_date] = null then 0
else (
fx_calBusinessDays(DateTime.Date([Lodged_date]), _toDate)
)
)
),When I tested with the original code with fully implemented 25 queries, it runs about / more than 2 hours but now it runs about an hour. Thanks.