<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculation time increases for each added Calculated Column - Power Query in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1473391#M45895</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For calculating &lt;STRONG&gt;PERCENTILE&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in Power Query, you can refer to this post:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/56294330/how-do-i-calculate-percentiles-in-powerquery-based-on-grouping-variables" target="_self"&gt;How do I calculate Percentiles in PowerQuery based on grouping variables?&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps,&lt;/STRONG&gt;then&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;consider Accepting it as the&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;solution to help other members find it faster.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 06:06:41 GMT</pubDate>
    <dc:creator>Icey</dc:creator>
    <dc:date>2020-11-04T06:06:41Z</dc:date>
    <item>
      <title>Calculation time increases for each added Calculated Column - Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1440462#M45016</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am pulling a csv file data into power query to do cleaning and transformations to the data. There are around 300K `Attrb` rows, of which i am only filtering Attrb1,Attrb3,Attrb4,Attr5,Attr6. These `Attrbs` i am pivoting from rows to columns after sorting them in descending order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initially, the data loads fast till the point i come to `adding custom calculated columns`.&amp;nbsp;When i add a new calculated Column to my table in Power Query on the previous step, the time to calculate and refresh the table in the Power Query editor seems to increase exponentially (from 48mb it increases to 2+ gb) per added column in my actual workbook. This is not evident on this sample workbook that i have attached as i have removed most transformations and merges ; but in my original workbook which contains groupings,mergings and pivotings. Due to this, it takes time for the calculated columns to load each time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, i am not able to figure out a way to add PERCENTILE calculations to the custom columns. See the last 3 columns in FORMULAS sheet. The formula calculations are shown in this sheet. Here is a sample data that i have attached in&amp;nbsp;&lt;A title="SampleBook" href="https://drive.google.com/file/d/1b1wNb9p1U15I4n0rMA3ieZmNaFk66V59/view?usp=sharing" target="_self"&gt;SampleBook.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Oct 2020 19:27:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1440462#M45016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-18T19:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation time increases for each added Calculated Column - Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441014#M45043</link>
      <description>&lt;P&gt;Hello Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the problem is here that you are referencing a column of a previous step on each row. Try this approach&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;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]/AverarageAttrb6,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),
    FilteredInnoRows = if drpInno =null then InsertedTotalAvgPercent else Table.SelectRows(InsertedTotalAvgPercent, each Text.Contains([INNO], drpInno,Comparer.OrdinalIgnoreCase))
in
    FilteredInnoRows&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt; or &lt;STRONG&gt;solves &lt;/STRONG&gt;your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)&lt;BR /&gt;Kudoes are nice too&lt;BR /&gt;&lt;BR /&gt;Have fun&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 05:56:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441014#M45043</guid>
      <dc:creator>Jimmy801</dc:creator>
      <dc:date>2020-10-19T05:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation time increases for each added Calculated Column - Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441039#M45044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="160408" data-lia-user-login="Jimmy801" class="lia-mention lia-mention-user"&gt;Jimmy801&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied your code to the Advanced editor, but i am getting the following error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Formula.Firewall: Query 'tblOriginal' (step 'FilteredInnoRows') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why this is happening?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My original code was :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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),
    InsertedAttrb6AvgPercent = Table.AddColumn(InsertedTotal, "Attrb6 Avg%", each [Attrb6]/List.Average(InsertedTotal[Attrb6]),Percentage.Type),
    InsertedAttrb4AvgPercent = Table.AddColumn(InsertedAttrb6AvgPercent, "Attrb4 Avg%", each [Attrb4]/List.Average(InsertedAttrb6AvgPercent[Attrb4]),Percentage.Type),
    InsertedTotalAvgPercent = Table.AddColumn(InsertedAttrb4AvgPercent, "Total%", each [Total]/List.Average(InsertedAttrb4AvgPercent[Total]),Percentage.Type),
    FilteredInnoRows = if drpInno =null then InsertedTotalAvgPercent else Table.SelectRows(InsertedTotalAvgPercent, each Text.Contains([INNO], drpInno,Comparer.OrdinalIgnoreCase))
in
    FilteredInnoRows&lt;/LI-CODE&gt;&lt;P&gt;...which is refering previous steps. But the only difference between your code and mine is that you are calculating the averages upfront (which i had tried earlier but still same loading time) but they are also still referencing previous steps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the difference to change the loading time? Is it because the data is referencing a 300K rows CSV file that gets filtered on 5-6 Attrb codes and then these are pivoted as columns?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 06:23:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441039#M45044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-19T06:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation time increases for each added Calculated Column - Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441144#M45049</link>
      <description>&lt;P&gt;Hello Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is because of the safety settings. Or you are ignoring them in the settings, or you are using this code instead&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;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&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt; or &lt;STRONG&gt;solves &lt;/STRONG&gt;your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)&lt;BR /&gt;Kudoes are nice too&lt;BR /&gt;&lt;BR /&gt;Have fun&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 06:56:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441144#M45049</guid>
      <dc:creator>Jimmy801</dc:creator>
      <dc:date>2020-10-19T06:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation time increases for each added Calculated Column - Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441203#M45055</link>
      <description>&lt;P&gt;The error was because of a typo `&lt;STRONG&gt;AverarageAttrb6&lt;/STRONG&gt;`&amp;nbsp; in this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    InsertedAttrb6AvgPercent = Table.AddColumn(InsertedTotal, "Attrb6 Avg%", each [Attrb6]/AverarageAttrb6,Percentage.Type),&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;After changing that, it is working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which list are you referring that is causing the loading issue? How do i resolve it correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Idea on how to calculate &lt;STRONG&gt;PERCENTILE&lt;/STRONG&gt; in Power Query for the last 3 columns?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 07:29:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1441203#M45055</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-19T07:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation time increases for each added Calculated Column - Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1473391#M45895</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For calculating &lt;STRONG&gt;PERCENTILE&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in Power Query, you can refer to this post:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/56294330/how-do-i-calculate-percentiles-in-powerquery-based-on-grouping-variables" target="_self"&gt;How do I calculate Percentiles in PowerQuery based on grouping variables?&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps,&lt;/STRONG&gt;then&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;consider Accepting it as the&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;solution to help other members find it faster.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 06:06:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Calculation-time-increases-for-each-added-Calculated-Column/m-p/1473391#M45895</guid>
      <dc:creator>Icey</dc:creator>
      <dc:date>2020-11-04T06:06:41Z</dc:date>
    </item>
  </channel>
</rss>

