Forum Discussion

Lucian's avatar
Lucian
Icon for Responsive Resident rankResponsive Resident
6 years ago
Solved

Formula.Firewall Error in combination with PowerQuery function

Hello,   I am trying to create a "dynamic union" of identical tables from a Navision database.  Basicaly I need come "consolidated data" without using the Consolidated company from NAV. These tabl...
  • ImkeF's avatar
    ImkeF
    6 years ago

    try to "functionize" the Company-query like so: (adding " () => " at the start)

     

    () =>
    let
        Source = Sql.Databases(NAVDataURL),
        DBSource = Source{[Name=NAVDBName]}[Data],
        dbo_Company = DBSource{[Schema="dbo",Item="Company"]}[Data],
        #"Removed Columns" = Table.RemoveColumns(dbo_Company,{"timestamp", "Evaluation Company"}),
        #"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Name] = "Comp1" or [Name] = "Comp2"))
    in
        #"Filtered Rows"

     

    and then call it like so: Company() 
    This is a function without a parameter, but you have to include the parenthesis.

     

    let
        Source = Company(),
        #"Invoked Custom Function" = Table.AddColumn(Source, "GetProjectsTable", each GetProjectsTable([Name]))
    in
        #"Invoked Custom Function"