let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"1", Int64.Type}, {"2", Int64.Type}, {"3", Int64.Type}, {"4", Int64.Type}, {"5", Int64.Type}, {"6", Int64.Type}, {"7", Int64.Type}, {"8", Int64.Type}, {"9", Int64.Type}, {"10", Int64.Type}, {"11", Int64.Type}, {"12", Int64.Type}, {"13", Int64.Type}, {"14", Int64.Type}, {"15", Int64.Type}, {"16", Int64.Type}, {"17", Int64.Type}, {"18", Int64.Type}, {"19", Int64.Type}, {"20", Int64.Type}, {"21", Int64.Type}, {"22", Int64.Type}, {"23", Int64.Type}, {"24", Int64.Type}, {"25", Int64.Type}, {"26", Int64.Type}, {"27", Int64.Type}, {"28", Int64.Type}, {"29", Int64.Type}, {"30", Int64.Type}, {"31", Int64.Type}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",null,0,Replacer.ReplaceValue,{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Name"}, "Attribute", "Value"),
#"Added Custom" = Table.AddColumn(#"Unpivoted Columns", "Custom", each if [Value] < 0 then "1" else "0" ),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Custom"}),
#"Added Custom1" = Table.AddColumn(#"Removed Columns", "Custom", each if [Value] < 0 then 1 else 0),
#"Added Index" = Table.AddIndexColumn(#"Added Custom1", "Index", 0, 1),
#"Added Custom2" = Table.AddColumn(#"Added Index", "Custom.1", each try if #"Added Index"{[Index]-1}[Custom] <> [Custom] then [Index] else null otherwise [Index]),
#"Filled Down" = Table.FillDown(#"Added Custom2",{"Custom.1"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"Name", "Custom", "Custom.1"}, {{"Count", each Table.RowCount(_), type number}}),
#"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each ([Custom] = 1)),
#"Grouped Rows1" = Table.Group(#"Filtered Rows", {"Name"}, {{"MaxNeg", each List.Max([Count]), type number}}),
#"Added Custom3" = Table.AddColumn(#"Grouped Rows1", "Flag", each if [MaxNeg] >= 7 then "Red" else "Green")
in
#"Added Custom3"