Forum Discussion
power query | parameter query to filter data a predefined list from google bigquery database
Does it work? 🙂
hi Olivierln & ChielFaber,
sori fr the late reply.
unfortunately it's still not working.
if i create a parameter with a query, i get flwg error msg
'Expression.Error: A cyclic reference was encountered during evaluation.'
if i change the parameter to a list of values, i get flwg error msg:
DataSource.Error: ODBC: ERROR [42000] [Microsoft][BigQuery] (70) Invalid query: Unrecognized name: JFK at [4:56]
Details:
DataSourceKind=GoogleBigQuery
DataSourcePath=GoogleBigQuery
OdbcErrors=[Table]
i tried to change power-query to get data from google bigquery currently is as flws:
let
Source = Value.NativeQuery(GoogleBigQuery.Database(){[Name="h2m-avia"]}[Data], "select * from h2m-avia.uk.uk where (ORIGIN in ( " & pmAirportSelect & ") or DEST in ( " & pmAirportSelect & "))", null, [EnableFolding=true]),
...
the m for the pmAirportSelect parameter is:
"ANC" meta [IsParameterQuery=true, ExpressionIdentifier=AirportList, Type="Text", IsParameterQueryRequired=true]
the m for AirpotList query list is:
let
Source = Table.Combine({ori, dest}),
#"Removed Duplicates" = Table.Distinct(Source),
#"Sorted Rows" = Table.Sort(#"Removed Duplicates",{{"STN", Order.Ascending}}),
STN1 = #"Sorted Rows"[STN]
in
STN1
the AirportList query list was generated by merging 2 files - ori & dest. these files were generated from the main dataset from google bigquery.
hope i can find a solution to this soonest as currently i hardcode the ORIGIN and DEST values.
tks, -nik