I'm trying to get a better idea of how to better optimize my Power Query code. Is there a way to profile queries and determine where they are spending their time?
So far all I've been able to come up with is to break the query apart into separate queries that I can then connect to tables in Excel time using the below VBA code. The problem is, it is quite laborious to break the queries down and track down performance issues. Especially since the act of breaking them down may change how they perform.
'MicroTimer from http://stackoverflow.com/a/7116928/2250183
Public Function TestQuery(connectionName As String) As Double
Dim startTime As Double
Dim connection As OLEDBConnection
Set connection = ThisWorkbook.Connections(connectionName).OLEDBConnection
connection.BackgroundQuery = False
startTime = MicroTimer()
connection.Refresh
TestQuery = MicroTimer() - startTime
connection.BackgroundQuery = True
End Function