<?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: Create a calculated column like running total but have limitations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2885383#M93506</link>
    <description>&lt;P&gt;Thank you for reply. But I have another problem that make thing more complicated. The same data sample as I already provided before, but now it have a column that have multiple ID, and I have to use that column ID to group by while calculating. How can I do to handle this problem?&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 10:50:26 GMT</pubDate>
    <dc:creator>Phuonghm22</dc:creator>
    <dc:date>2022-11-04T10:50:26Z</dc:date>
    <item>
      <title>Create a calculated column like running total but have limitations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2883425#M93408</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have a problem. I want to create a calculated column call ExpectedOutcome .&lt;/P&gt;&lt;P&gt;The value of column ExpectedOutcome for 1st row where No.Session = 1 is calculated by Score + 90.&lt;BR /&gt;From the second row, the value of&amp;nbsp;ExpectedOutcome = previous&amp;nbsp;ExpectedOutcome + Score.&lt;/P&gt;&lt;P&gt;The value&amp;nbsp;of&amp;nbsp;ExpectedOutcome is always in the range of 0 - 100. If it &amp;lt; 0, then we put 0 as the value. If it &amp;gt; 100, then we put 100 as the value.&lt;/P&gt;&lt;P&gt;It seems like calculate a running total, but it is not. And I do not know how to solve this problem.&lt;/P&gt;&lt;P&gt;Plz help me. Thank you.&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 16:28:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2883425#M93408</guid>
      <dc:creator>Phuonghm22</dc:creator>
      <dc:date>2022-11-03T16:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create a calculated column like running total but have limitations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2884460#M93468</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="464170" data-lia-user-login="Phuonghm22" class="lia-mention lia-mention-user"&gt;Phuonghm22&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;There is no recursive function in computed columns, you can use Power Query:&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Power Query – Home &amp;nbsp;-- Advanced Editor.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Put the following code in it.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tc/RDcAgCEXRXfjWxIfV2lmM+69REAv9MYeGeO2cBErEtNKU81N1Xa7m6q7bNUS5bT7+EUVYjYgFRAhRQqTQfstRQ+QwgtrLvdgvaDHXM+wmn4H3YNaqXc9aPRtalSev9QI=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [No.Session = _t, Score = _t]),
    test = Table.TransformColumnTypes(Source,{{"No.Session", Int64.Type}, {"Score", Int64.Type}}),
    #"Added Custom" = Table.TransformColumns(Table.AddColumn(test, "Custom", (x)=&amp;gt;  List.Accumulate(List.Range(test[Score],0,x[No.Session]),0,(x,y)=&amp;gt;if x+y &amp;gt;=10 then 10 else if x+y&amp;lt;=-90 then -90 else x+y)             ),{"Custom",(x)=&amp;gt;x+90})
in
    #"Added Custom"&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 04:28:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2884460#M93468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-04T04:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a calculated column like running total but have limitations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2885383#M93506</link>
      <description>&lt;P&gt;Thank you for reply. But I have another problem that make thing more complicated. The same data sample as I already provided before, but now it have a column that have multiple ID, and I have to use that column ID to group by while calculating. How can I do to handle this problem?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 10:50:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-calculated-column-like-running-total-but-have/m-p/2885383#M93506</guid>
      <dc:creator>Phuonghm22</dc:creator>
      <dc:date>2022-11-04T10:50:26Z</dc:date>
    </item>
  </channel>
</rss>

