Hi @prafullchavan1,
As a courtesy to members providing support in their personal time, please note these concerns from the onset. This will save time and ensure you receive a “better” response, with that said, give this a go.
let
transformActivityMilestones = (t as table, skip as number) as table =>
[
lookFor = List.Buffer(
{
"Percentage",
"Description",
"Progress",
"Earned",
"Planned",
"Actual",
"Forecast",
"Primavera"
}
),
// lookFor needs to map to the corresponding replWith value
replWith = List.Buffer(
{
"MILESTONE_LABEL_PERCENTAGE",
"MILESTONE_LABEL_DESCRIPTION",
"Step - Progress %",
"EARNED_MAN_HOURS_PHASE",
"PLANNED_DATE",
"ACTUAL_DATE",
"FORECAST_DATE",
"PRIMAVERA_CODE"
}
),
asCols = Table.ToColumns(t),
colNames = Table.ColumnNames(t),
nameChunks = List.Transform(
List.Split(List.Skip(colNames, skip), 8),
each List.Transform( _, (x) => replWith{
List.PositionOf(
List.Transform( lookFor,
(y) => Text.Contains(x, y, Comparer.OrdinalIgnoreCase)
), true
)
})
),
dataChunks = List.Split( List.Skip( asCols, skip), 8),
collectChunks = Table.Combine(
List.Transform(
List.Zip({dataChunks, nameChunks}),
each Table.FromColumns(
List.FirstN(asCols, skip) & _{0},
List.FirstN(colNames, skip) & _{1}
)
)
)
][collectChunks],
Source = EnterYourTableRefenceHere,
InvokedFunction = transformActivityMilestones(Source, 2)
in
InvokedFunction
With this result
I hope this is helpful