<?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: SUM depending on that in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002199#M157642</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;- You are trying to create a Calculated Column by the sounds of it, you need to create a Measure to use the code I have provided.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find and click the icon stating New Measure below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 14:02:55 GMT</pubDate>
    <dc:creator>mark_endicott</dc:creator>
    <dc:date>2024-06-20T14:02:55Z</dc:date>
    <item>
      <title>SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001669#M157636</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hi everyone, I would like to have a measure that calculates the revenue depending on the year 2023 and 2024. Therefore, I can create another measure to calcultate the % evolution etc.&lt;/P&gt;&lt;P&gt;Do you know how I can do that ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 09:58:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001669#M157636</guid>
      <dc:creator>ConstantDele</dc:creator>
      <dc:date>2024-06-20T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001774#M157637</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;- you can create individual measures for 2023 and 2024 for revenue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg:&amp;nbsp;Revenue 2023 =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Sales[Revenue]),&lt;BR /&gt;YEAR(Sales[Date]) = 2023&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;create another measure for 2024 for revenue.create final measure to calculate the percentage evolution of revenue from 2023 to 2024&lt;/P&gt;&lt;P&gt;Revenue Evolution % =&lt;BR /&gt;IF(&lt;BR /&gt;[Revenue 2023] = 0,&lt;BR /&gt;BLANK(),&lt;BR /&gt;([Revenue 2024] - [Revenue 2023]) / [Revenue 2023] * 100&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check the above calcualtion to get the percentage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! This will help others on the forum!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 10:52:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001774#M157637</guid>
      <dc:creator>rajendraongole1</dc:creator>
      <dc:date>2024-06-20T10:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001867#M157638</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;- If you want you can do this in one measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% Evolution = 
VAR _2023 = CALCULATE( SUM( 'Table (3)'[amount] ), YEAR( 'Table (3)'[date] ) = 2023 )
VAR _2024 = CALCULATE( SUM( 'Table (3)'[amount] ), YEAR( 'Table (3)'[date] ) = 2024 )
VAR change = _2024 - _2023
RETURN
    DIVIDE ( change, _2023 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want separate measures for 2023 and 2024, you can just take the code out of the VAR's for each year and then reference the measures themselves like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% Evolution = 
VAR _2023 = [2023]
VAR _2024 = [2024]
VAR change = _2024 - _2023
RETURN
    DIVIDE ( change, _2023 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please accept as the solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 11:43:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001867#M157638</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-06-20T11:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001914#M157639</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply but whenever I do the calculate sum formula, it just takes the whole quantity, and doesn't filter on any year.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:04:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4001914#M157639</guid>
      <dc:creator>ConstantDele</dc:creator>
      <dc:date>2024-06-20T12:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002030#M157640</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;- Did you use the DAX formula's below?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2023 = CALCULATE( SUM( 'Table (3)'[amount] ), YEAR( 'Table (3)'[date] ) = 2023 )
2024 = CALCULATE( SUM( 'Table (3)'[amount] ), YEAR( 'Table (3)'[date] ) = 2024 )&lt;/LI-CODE&gt;&lt;P&gt;They will only show on rows where the year matches the filter, see below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 13:01:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002030#M157640</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-06-20T13:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002127#M157641</link>
      <description>&lt;P&gt;Thanks, but whenever I write YEAR, it doesn't push me to write my table, but only (YEAR(DATE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 13:41:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002127#M157641</guid>
      <dc:creator>ConstantDele</dc:creator>
      <dc:date>2024-06-20T13:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002199#M157642</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;- You are trying to create a Calculated Column by the sounds of it, you need to create a Measure to use the code I have provided.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find and click the icon stating New Measure below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 14:02:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4002199#M157642</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-06-20T14:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4009102#M157643</link>
      <description>&lt;P&gt;It worked thanks. What would be the formula if I want to have all the sales from a specific Month ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what is the formula to have the qty sold in the current month ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 12:43:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4009102#M157643</guid>
      <dc:creator>ConstantDele</dc:creator>
      <dc:date>2024-06-25T12:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4009353#M157644</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;- As my DAX has worked, please could you mark it as the solution, this helps other users find it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To find a specific month, you can amend the DAX to take in a month input also, the below will work for current month.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _Month = MONTH(NOW())
VAR _Year = YEAR(NOW())

RETURN
CALCULATE( SUM( 'Table (3)'[amount] ), YEAR( 'Table (3)'[date] ) = _Year &amp;amp;&amp;amp; MONTH( 'Table (3)'[date] ) = _Month )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To change this to a specific month,&amp;nbsp;you can amend the variables (VAR) to show a number from 1 to 12 for any specific month, and a year, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _Month = 6
VAR _Year = 2024

RETURN
CALCULATE( SUM( 'Table (3)'[amount] ), YEAR( 'Table (3)'[date] ) = _Year &amp;amp;&amp;amp; MONTH( 'Table (3)'[date] ) = _Month )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column inside the SUM( ) can also be changed for your QTY sold column.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 14:49:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4009353#M157644</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-06-25T14:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: SUM depending on that</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4013139#M158049</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="735755" data-lia-user-login="ConstantDele" class="lia-mention lia-mention-user"&gt;ConstantDele&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&lt;SPAN&gt;please could you mark it as the solution, this helps other users find it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 09:43:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-depending-on-that/m-p/4013139#M158049</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-06-27T09:43:25Z</dc:date>
    </item>
  </channel>
</rss>

