Forum Discussion
Calculation time increases for each added Calculated Column - Power Query
- 5 years ago
Hi Anonymous ,
For calculating PERCENTILE in Power Query, you can refer to this post:
How do I calculate Percentiles in PowerQuery based on grouping variables?
Best regards
Icey
If this post helps,then consider Accepting it as the solution to help other members find it faster.
Hello Anonymous
this is because of the safety settings. Or you are ignoring them in the settings, or you are using this code instead
let
Source = Excel.CurrentWorkbook(){[Name="Table13"]}[Content],
ChangedType = Table.TransformColumnTypes(Source,{{"INNO", type text}, {"INNO_SORT", Int64.Type}, {"Attrb6", Int64.Type}, {"Attrb5", Int64.Type}, {"Attrb4", Int64.Type}, {"Attrb3", Int64.Type}, {"Attrb1", Int64.Type}}),
InsertedTotal = Table.AddColumn(ChangedType, "Total", each [Attrb6] + [Attrb4], Int64.Type),
AverageAttrb6 = List.Average(InsertedTotal[Attrb6]),
InsertedAttrb6AvgPercent = Table.AddColumn(InsertedTotal, "Attrb6 Avg%", each [Attrb6]/AverageAttrb6,Percentage.Type),
AverageAttrb4 = List.Average(InsertedAttrb6AvgPercent[Attrb4]),
InsertedAttrb4AvgPercent = Table.AddColumn(InsertedAttrb6AvgPercent, "Attrb4 Avg%", each [Attrb4]/AverageAttrb4,Percentage.Type),
AverageTotal = List.Average(InsertedAttrb4AvgPercent[Total]),
InsertedTotalAvgPercent = Table.AddColumn(InsertedAttrb4AvgPercent, "Total%", each [Total]/AverageTotal,Percentage.Type),
GetFilter =
let
Source = Excel.CurrentWorkbook(){[Name="drpInno"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"INNO", type any}})[INNO]{0}
in
#"Changed Type",
FilteredInnoRows = if drpInno =null then InsertedTotalAvgPercent else Table.SelectRows(InsertedTotalAvgPercent, each Text.Contains([INNO], GetFilter,Comparer.OrdinalIgnoreCase))
in
FilteredInnoRows
no, it's the referecing that makes the difference. in a new column, you are refercing a list and it has to be evaluated each time.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
The error was because of a typo `AverarageAttrb6` in this line:
InsertedAttrb6AvgPercent = Table.AddColumn(InsertedTotal, "Attrb6 Avg%", each [Attrb6]/AverarageAttrb6,Percentage.Type),
After changing that, it is working.
Which list are you referring that is causing the loading issue? How do i resolve it correctly?
Any Idea on how to calculate PERCENTILE in Power Query for the last 3 columns?
- Icey5 years agoCommunity Support
Hi Anonymous ,
For calculating PERCENTILE in Power Query, you can refer to this post:
How do I calculate Percentiles in PowerQuery based on grouping variables?
Best regards
Icey
If this post helps,then consider Accepting it as the solution to help other members find it faster.