<?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 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2436555#M65047</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374942" data-lia-user-login="LoredanaC" class="lia-mention lia-mention-user"&gt;LoredanaC&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could use the ABS function &lt;STRONG&gt;or&lt;/STRONG&gt; create an IF clause &lt;STRONG&gt;or&lt;/STRONG&gt; turn all negative values of your columns into positive numbers in Power Query (choose absolute value).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here a similar thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-convert-negative-numbers-into-positive-numbers/m-p/33538" target="_blank" rel="noopener"&gt;How to convert negative numbers into positive numb... - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this solve your issue. Otherwise I am more than happy to assist you further &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="noopener"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 19:53:02 GMT</pubDate>
    <dc:creator>tackytechtom</dc:creator>
    <dc:date>2022-04-04T19:53:02Z</dc:date>
    <item>
      <title>Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2436509#M65040</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I calculate the value=quantite*price. If the value from a column from this table named A&amp;gt;0, then my calculate value=quantite*price, else if value from A column from my table&amp;lt;0, then calculate value=quantite*price*(-1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 19:26:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2436509#M65040</guid>
      <dc:creator>LoredanaC</dc:creator>
      <dc:date>2022-04-04T19:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2436555#M65047</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374942" data-lia-user-login="LoredanaC" class="lia-mention lia-mention-user"&gt;LoredanaC&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could use the ABS function &lt;STRONG&gt;or&lt;/STRONG&gt; create an IF clause &lt;STRONG&gt;or&lt;/STRONG&gt; turn all negative values of your columns into positive numbers in Power Query (choose absolute value).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here a similar thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-convert-negative-numbers-into-positive-numbers/m-p/33538" target="_blank" rel="noopener"&gt;How to convert negative numbers into positive numb... - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this solve your issue. Otherwise I am more than happy to assist you further &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="noopener"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 19:53:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2436555#M65047</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-04-04T19:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2442037#M65436</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374942" data-lia-user-login="LoredanaC" class="lia-mention lia-mention-user"&gt;LoredanaC&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;You can create a calculated column like this :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;value = SWITCH(TRUE(),'Table'[A]&amp;gt;0,'Table'[price]*'Table'[quantite],'Table'[A]&amp;lt;0,'Table'[price]*'Table'[quantite]*-1)&lt;/LI-CODE&gt;
&lt;P&gt;The final result is shown as below .&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I have attached my pbix file , you can refer to it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 03:25:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation/m-p/2442037#M65436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-07T03:25:24Z</dc:date>
    </item>
  </channel>
</rss>

