Forum Discussion

JimiH's avatar
JimiH
Frequent Visitor
9 years ago
Solved

variable used in multiple queries

Hello   I have a value 'LocID' that appears in multiple tables in a SQL db I have. At the moment I have to change the filter value multiple times in my quiries to get the deired results.   I wa...
  • JimiH's avatar
    JimiH
    9 years ago

    Think I have it

     

    let
        Source = Sql.Database("eu-ske-sql-03", "ANL_ProAss"),
        dbo_OEE_FOR_BI = Source{[Schema="dbo",Item="OEE_FOR_BI"]}[Data],

         #"Sorted Rows" = Table.Sort(dbo_OEE_FOR_BI,{{"ShiftDay", Order.Descending}}),

        #"Filtered Rows" = Table.SelectRows(dbo_OEE_FOR_BI, each [LocId]=LineNumberPar)
    in
        #"Filtered Rows"