let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("rVFdC4IwFP0rsmeHaT3U423OCLKirQjUh1FDhLHA6f8v02ZfUEQvl53DvefsnpskiISRMxXGSG2Qq2ulXEQA2Db1ZpxQ7A/RP4jMbZ2YUEpaoxgYrMmlK1ptcIC+Idick9Uy6pjxG+ZqNWcOlGk9GMixcRbtI5ed7/OWBE/QR9wM3aQf82rlNhAG3R989Axtn1WQqtDXKqs+DQrrbmaEPuJXzSIX+mTDZYzFqUf3HDf3+Bo9KJZ13l9rBxhmwHmTCRC7Vh/UkuJg+Gof2JMQcSyUEof74N6Uvt1Ul/6Ttpoh9e8y/h1m2Rk=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Centre de Formation" = _t, #"01/01/2024" = _t, #"02/01/2024" = _t, #"03/01/2024" = _t, #"04/01/2024" = _t, #"05/01/2024" = _t, #"06/01/2024" = _t]),
UnpivotColumns = Table.UnpivotOtherColumns(Source, {"Centre de Formation"}, "Date", "Intitulé"),
ConvertDates = Table.TransformColumns(UnpivotColumns,{{"Date", each Date.FromText(_, [Culture="fr-FR"]), type date}}),
GroupBy = Table.Group(ConvertDates, {"Intitulé", "Centre de Formation"}, {{"Date de début", each List.Min([Date]), type date}, {"Date de fin", each List.Max([Date]), type date}}),
AddColumnNbDays = Table.AddColumn(GroupBy, "Nbre de jours", each Duration.Days([Date de fin]-[Date de début])+1, Int64.Type)
in
AddColumnNbDays