<?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: Need help creating new column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283267#M170000</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777354" data-lia-user-login="praveenjujare" class="lia-mention lia-mention-user"&gt;praveenjujare&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pease try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
IF(
    'Investment'[Transaction Type] = "Shares Adjustment",
    VAR PreviousRowPrice = CALCULATE(
        MAX('Investment'[Price]),
        FILTER(
            'Investment',
            'Investment'[Index] = EARLIER('Investment'[Index]) - 1
        )
    )
    VAR PreviousRowClosingShare = CALCULATE(
        MAX('Investment'[Closing Share]),
        FILTER(
            'Investment',
            'Investment'[Index] = EARLIER('Investment'[Index]) - 1
        )
    )
    RETURN
        (PreviousRowPrice * PreviousRowClosingShare) / 'Investment'[Closing Share],
    BLANK()
)&lt;/LI-CODE&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;Bof&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 07:05:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-14T07:05:44Z</dc:date>
    <item>
      <title>Need help creating new column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4281854#M169926</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; Share adjustment price =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR _INDEX = MAX('Investment'[Index])&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR _INDEX_1 = _INDEX - 1&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR a = SUMX('Investment', 'Investment'[Qty])&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR b = SUMX('Investment', 'Investment'[Price])&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR c = [Closing Share]&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR d =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Closing Share],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Investment'[Index] = _INDEX_1&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR e = (b * a) / c&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SWITCH(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Investment', 'Investment'[Transaction Type] = "Shares Adjustment", e,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 13:41:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4281854#M169926</guid>
      <dc:creator>praveenjujare</dc:creator>
      <dc:date>2024-11-13T13:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help creating new column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4282049#M169937</link>
      <description>&lt;P&gt;please shere more detail or pbix file.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 15:18:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4282049#M169937</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-11-13T15:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help creating new column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4282824#M169977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777354" data-lia-user-login="praveenjujare" class="lia-mention lia-mention-user"&gt;praveenjujare&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the DAX you provided, I’m not able to fully understand the calculation logic for this new column. Could you please describe the calculation logic for this column in words?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Bof&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 02:38:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4282824#M169977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-14T02:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help creating new column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283052#M169987</link>
      <description>&lt;P&gt;When transaction type = share adjustment then (previous row of price * previous row of closing share )/ present row of closing share&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp; &amp;nbsp;(65.4 * 273000)/2730000&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 05:30:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283052#M169987</guid>
      <dc:creator>praveenjujare</dc:creator>
      <dc:date>2024-11-14T05:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help creating new column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283267#M170000</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777354" data-lia-user-login="praveenjujare" class="lia-mention lia-mention-user"&gt;praveenjujare&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pease try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
IF(
    'Investment'[Transaction Type] = "Shares Adjustment",
    VAR PreviousRowPrice = CALCULATE(
        MAX('Investment'[Price]),
        FILTER(
            'Investment',
            'Investment'[Index] = EARLIER('Investment'[Index]) - 1
        )
    )
    VAR PreviousRowClosingShare = CALCULATE(
        MAX('Investment'[Closing Share]),
        FILTER(
            'Investment',
            'Investment'[Index] = EARLIER('Investment'[Index]) - 1
        )
    )
    RETURN
        (PreviousRowPrice * PreviousRowClosingShare) / 'Investment'[Closing Share],
    BLANK()
)&lt;/LI-CODE&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;Bof&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 07:05:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283267#M170000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-14T07:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help creating new column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283417#M170006</link>
      <description>&lt;P&gt;Thanks sir&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 08:04:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-creating-new-column/m-p/4283417#M170006</guid>
      <dc:creator>praveenjujare</dc:creator>
      <dc:date>2024-11-14T08:04:05Z</dc:date>
    </item>
  </channel>
</rss>

