<?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: DAX IF Sum Statement in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943506#M10133</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="149410" data-lia-user-login="ahmedoye" class="lia-mention lia-mention-user"&gt;ahmedoye&lt;/a&gt;&amp;nbsp;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2020 21:44:46 GMT</pubDate>
    <dc:creator>hawkeyes12</dc:creator>
    <dc:date>2020-02-21T21:44:46Z</dc:date>
    <item>
      <title>DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943212#M10116</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I need help with creating a DAX Formula. I have four columns in my table called "Transactions":&lt;/P&gt;&lt;P&gt;1. Date&lt;/P&gt;&lt;P&gt;2. Fund ID&lt;/P&gt;&lt;P&gt;3. Frequency&lt;/P&gt;&lt;P&gt;4. Dividends&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I need to write a formula that does the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If [Frequency]="M" then sum the [Dividends] Column for the last 30 days&lt;/LI&gt;&lt;LI&gt;If [Frequency]="Q" then sum the [Dividends] Column for the last 90 days&lt;/LI&gt;&lt;LI&gt;If [Frequency]="A" then sum the [Dividends] Column for the last 365 days&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could someone please help me with this? I am new to DAX and am lost on whether I should use the Calculate formula, IF formula, etc.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 17:42:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943212#M10116</guid>
      <dc:creator>hawkeyes12</dc:creator>
      <dc:date>2020-02-21T17:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943223#M10117</link>
      <description>&lt;P&gt;You likely want to use a SWITCH statement. And you will likely want to calculate your value using a SUMX statement with a FILTER although you could also use CALCULATE with a FILTER statement. So either:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUMX(FILTER('Table',....),[Dividends])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CALCULATE(SUM([Dividends]),FILTER(...))&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 17:46:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943223#M10117</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-02-21T17:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943252#M10119</link>
      <description>&lt;P&gt;Hi - thank you for the response. Could you please explain what you mean by a SWITCH Statement?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 18:13:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943252#M10119</guid>
      <dc:creator>hawkeyes12</dc:creator>
      <dc:date>2020-02-21T18:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943475#M10125</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135887" data-lia-user-login="hawkeyes12" class="lia-mention lia-mention-user"&gt;hawkeyes12&lt;/a&gt;&amp;nbsp;, I like to break down my DAX into pieces to make it easier to write, read and understand. This is what you should write, assuming the dates start counting from today:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;DividendSum =&amp;nbsp; SUM(YourTable[Dividends])&lt;/LI&gt;&lt;LI&gt;MDividends = CALCULATE([DividendSum], FILTER(YourTable, YourTable[Frequency] = "M" &amp;amp;&amp;amp; YourTable[Date] &amp;gt;= TODAY() -30))&lt;/LI&gt;&lt;LI&gt;QDividends = CALCULATE([DividendSum], FILTER(YourTable, YourTable[Frequency] = "Q" &amp;amp;&amp;amp; YourTable[Date] &amp;gt;= TODAY() -90))&lt;/LI&gt;&lt;LI&gt;ADividends = CALCULATE([DividendSum], FILTER(YourTable, YourTable[Frequency] = "A" &amp;amp;&amp;amp; YourTable[Date] &amp;gt;= TODAY() -365))&lt;/LI&gt;&lt;LI&gt;DividendsUsed = SWITCH(TRUE(), YourTable[Frequency] = "M", [MDividends], YourTable[Frequency] = "Q", QDividends, YourTable[Dividends] = "A", ADividends)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;If this solves the problem, kindly mark my response as a solution&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:11:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943475#M10125</guid>
      <dc:creator>ahmedoye</dc:creator>
      <dc:date>2020-02-21T21:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943496#M10127</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="149410" data-lia-user-login="ahmedoye" class="lia-mention lia-mention-user"&gt;ahmedoye&lt;/a&gt;&amp;nbsp;this is very helpful! If the dates don't start counting from today and instead start counting from the most recent date in the [Date] column, how would this change the formula? For example, this calculation will be performed in mid-March and the source file will include data from 2/28/2019 to 2/29/2020. The first date that we would want included in the 30, 90 and 365 day calculation is 2/29/2020.&lt;BR /&gt;I am having a very hard time with the date functions so any guidance you may have is very appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:28:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943496#M10127</guid>
      <dc:creator>hawkeyes12</dc:creator>
      <dc:date>2020-02-21T21:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943498#M10128</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135887" data-lia-user-login="hawkeyes12" class="lia-mention lia-mention-user"&gt;hawkeyes12&lt;/a&gt;&amp;nbsp;, let your measures be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;DividendSum =&amp;nbsp; SUM(YourTable[Dividends])&lt;/LI&gt;&lt;LI&gt;HighestDate = MAXX(ALL('Table'[end date 1]),'Table'[end date 1])&lt;/LI&gt;&lt;LI&gt;MDividends = CALCULATE([DividendSum], FILTER(YourTable, YourTable[Frequency] = "M" &amp;amp;&amp;amp; YourTable[Date] &amp;gt;= [HighestDate] -30))&lt;/LI&gt;&lt;LI&gt;QDividends = CALCULATE([DividendSum], FILTER(YourTable, YourTable[Frequency] = "Q" &amp;amp;&amp;amp; YourTable[Date] &amp;gt;= [HighestDate] -90))&lt;/LI&gt;&lt;LI&gt;ADividends = CALCULATE([DividendSum], FILTER(YourTable, YourTable[Frequency] = "A" &amp;amp;&amp;amp; YourTable[Date] &amp;gt;= [HighestDate] -365))&lt;/LI&gt;&lt;LI&gt;DividendsUsed = SWITCH(TRUE(), YourTable[Frequency] = "M", [MDividends], YourTable[Frequency] = "Q", QDividends, YourTable[Dividends] = "A", ADividends)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;If this solves the problem, kindly mark my response as a solution&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:37:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943498#M10128</guid>
      <dc:creator>ahmedoye</dc:creator>
      <dc:date>2020-02-21T21:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAX IF Sum Statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943506#M10133</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="149410" data-lia-user-login="ahmedoye" class="lia-mention lia-mention-user"&gt;ahmedoye&lt;/a&gt;&amp;nbsp;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:44:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-IF-Sum-Statement/m-p/943506#M10133</guid>
      <dc:creator>hawkeyes12</dc:creator>
      <dc:date>2020-02-21T21:44:46Z</dc:date>
    </item>
  </channel>
</rss>

