Если вы хотите удалить все дубликаты в указанных столбцах, независимо от значений в оставшихся столбцах [Продукт, Дата прогноза, Месяц в прогнозе, Атрибут], используйте
#"Added Index" = Table.AddIndexColumn(#"Reordered Columns2", "Index", 0, 1),
#"Removed Other Columns" = Table.SelectColumns(#"Added Index",{"Product", "Forecast Date", "Month in Forecast", "Attribute", "Index"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Other Columns", {"Index"}, "Attribute.1", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Added Index",{"Product", "Forecast Date", "Month in Forecast", "Attribute"}),
#"Unpivoted Other Columns2" = Table.UnpivotOtherColumns(#"Removed Columns", {"Index"}, "Attribute.1", "Value"),
#"Removed Duplicates" = Table.Distinct(#"Unpivoted Other Columns2", {"Attribute.1", "Value"}),
Combined = #"Unpivoted Other Columns" & #"Removed Duplicates",
#"Pivoted Column" = Table.Pivot(Combined, List.Distinct(Combined[Attribute.1]), "Attribute.1", "Value"),
#"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Index"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns1",{{"Forecast Date", type date}, {"Month in Forecast", type date}})
in #"Changed Type1"
Если вы хотитеудалите все дубликаты в указанных столбцах на основе первой группировки по [Продукт, Дата прогноза, Месяц в прогнозе, Атрибут], затем используйте
#"Added Index" = Table.AddIndexColumn(#"Reordered Columns2", "Index", 0, 1),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Added Index", {"Product", "Forecast Date", "Month in Forecast", "Attribute","Index"}, "Attribute.1", "Value"),
#"Removed Duplicates1" = Table.Distinct(#"Unpivoted Other Columns", {"Product", "Forecast Date", "Month in Forecast", "Attribute", "Attribute.1", "Value"}),
#"Pivoted Column" = Table.Pivot(#"Removed Duplicates1", List.Distinct(#"Removed Duplicates1"[Attribute.1]), "Attribute.1", "Value", List.Sum),
#"Sorted Rows" = Table.Sort(#"Pivoted Column",{{"Index", Order.Ascending}}),
#"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"Index"})
in #"Removed Columns"