Forum Discussion
Anonymous
4 years agoNot applicable
Filter table by values not contained in a list
Hi! I have the following script in M : let Source = Sql.Database("17x.Xx.xx.x", "XXX", [Query = "SELECT TOP 100#(lf)YEARWEEK_DATE,#(lf)YEARMONTH_DATE,#(lf)CONVERT(date, CONVERT(varchar(8), (year...
ronrsnfld
4 years agoSuper User
Here is an example of one method:
let
ListaDistintos={202204,202201,202211},
#"Current History Table" = Table.FromColumns(
{{202204, 202203, 202202, 202201, 202112, 202211}}, {"Date?"}),
#"Filtered History" = Table.SelectRows(#"Current History Table",
each not List.Contains(ListaDistintos,[#"Date?"]))
in #"Filtered History"Anonymous
4 years agoNot applicable
Hi,ronrsnfld , I have to use Listcontains() or List.ContainsAny() ?... I´m comparing a list of values, vs lot of values, not only one... ???
- ronrsnfld4 years agoSuper User
No. You compare each entry in the column, one at a time, to the contents of your List. What happened when ran the code I posted? Here it returned the items you specified in your question.