let
//lecture parametres
Z1_Banque = Excel.CurrentWorkbook(){[Name="Z1_BANQUE"]}[Content]{0}[Column1],
Z1_Annee = if Excel.CurrentWorkbook(){[Name="Z1_ANNEE"]}[Content]{0}[Column1] =null
then null
else Excel.CurrentWorkbook(){[Name="Z1_ANNEE"]}[Content]{0}[Column1] ,
Z1_TYPE = if Excel.CurrentWorkbook(){[Name="Z1_TYPE"]}[Content]{0}[Column1] <> null
then Excel.CurrentWorkbook(){[Name="Z1_TYPE"]}[Content]{0}[Column1]
else null ,
// on commence
Source = Excel.CurrentWorkbook(){[Name="Etat_Lieux"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"TYPE", type text}, {"BANQUE", type text}, {"NO DEAL", Int64.Type}, {"NO DEAL BANQUE", type text}, {"DEVISE", type text}, {"Année", Int64.Type}, {"DATE RATE SET", type text}, {"MAILS RECU PAR LA BANQUE AUTOMATIQUEMENT", type text}, {"MAILS ENVOYE PAR CFM POUR DEMANDE", type text}, {"COMMENTAIRES", type text}}),
#"Filter Annee" = if Z1_Annee <> null
then Table.SelectRows(#"Changed Type", each [Année] = Z1_Annee)
else #"Changed Type",
#"Filtered Rows1" = Table.SelectRows(#"Filter Annee", each Text.Contains(Text.Upper([BANQUE] ) , Text.Upper( Z1_Banque))),
#"Filt type" = if Z1_TYPE = null then #"Filtered Rows1" else Table.SelectRows(#"Filtered Rows1", each [TYPE] = Z1_TYPE),
#"Removed Columns" = Table.RemoveColumns(#"Filt type",{"MAILS ENVOYE PAR CFM POUR DEMANDE", "COMMENTAIRES"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each [MAILS RECU PAR LA BANQUE AUTOMATIQUEMENT] = "OUI")
in
#"Filtered Rows"