I have a Power Query which is pulling data from a very large table (over a million rows). When I try to add a parameter, no matter where in the query I put it, the query pulls the entire table, and then filters it down based on the parameter. It's taking a full minute to pull all the information, so my question is this:
Is there a way to structure the Power Query such that it only pulls the data I want, based on the parameter, and not the entire table?
Thanks! :)
The connection is using Excel's Get Data function, and the parameter, is being entered as part of a filter
Here's an example of the type of query where BegPer and EndPer are the beginning and ending parameters:
let
Source = Sql.Databases("TIRPROD-MIRROR"),
SLZZZAPP = Source{[Name="SLZZZAPP"]}[Data],
dbo_AcctHist = SLZZZAPP{[Schema="dbo",Item="AcctHist"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(dbo_AcctHist,{{"FiscYr", Int64.Type}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [FiscYr] >= BegPer and [FiscYr] <= EndPer)
in #"Filtered Rows"