<?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: Total current month if prior month value = 0 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1480438#M28232</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share the pbix?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Nov 2020 12:14:18 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-11-07T12:14:18Z</dc:date>
    <item>
      <title>Total current month if prior month value = 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1479991#M28217</link>
      <description>&lt;P&gt;Help!&amp;nbsp; I've been tried more suggestions from this community than I can count, including Greg Deckler's patterns, and still can't seem to get the correct total.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My fact table has project budgets by Month and Year.&amp;nbsp; I've created measures for current and prior months, which work as expected regardless off the month selected in the slicer.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the business wants to see current month values where Prior Month = 0 so I wrote this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NoPriorAmount = VAR prior = [PriorMoEACRev]&lt;/P&gt;&lt;P&gt;VAR currmon = [CurrEACRev]&lt;/P&gt;&lt;P&gt;RETURN IF(prior=0,[CurrEACRev],0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of couse the total row value is 0.&lt;/P&gt;&lt;P&gt;The measure will need to be sliced by a location and business unit dimensions.&amp;nbsp; Any help would be greatly appreciated.&amp;nbsp; See below for a table with sample data from the fact table, followed by my measures.&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;PriorMonEAC = CALCULATE(SUM(Bookings[eacrv]),DATEADD('Calendar'[Date],-1,MONTH))&lt;/P&gt;&lt;P&gt;CurrEAC = SUM(Bookings[eacrv])&lt;/P&gt;&lt;P&gt;NoPriorAmount = VAR prior = [PriorMoEACRev]&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;VAR currmon = [CurrEACRev]&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;RETURN IF(prior=0,[CurrEACRev],0)&lt;/P&gt;&lt;P&gt;Total New Bkgs = Total New Bkgs = VAR __table = SUMMARIZE('Services Lines',"__value",[New Bookings])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;RETURN&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;IF(HASONEVALUE('Services Lines'[Line of Service]),[New Bookings],SUMX(__table,[__value]))&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 21:00:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1479991#M28217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-06T21:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Total current month if prior month value = 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1480438#M28232</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share the pbix?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 12:14:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1480438#M28232</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-07T12:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Total current month if prior month value = 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1481459#M28289</link>
      <description>&lt;LI-CODE lang="cpp"&gt;NoPriorAmount =
SUMX (
    VALUES ( Project[Project] ),
    VAR prior = [PriorMoEACRev]
    VAR currmon = [CurrEACRev]
    RETURN
        IF ( prior = 0, [CurrEACRev], 0 )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Nov 2020 01:44:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1481459#M28289</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2020-11-09T01:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Total current month if prior month value = 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1482993#M28341</link>
      <description>&lt;P&gt;Thank you!!&amp;nbsp; That works.&amp;nbsp; Performance is slow, but the result is accurate.&amp;nbsp; &amp;nbsp;I'm marking this as the solution, although if anyone has recommendations to improve performance that would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:33:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-current-month-if-prior-month-value-0/m-p/1482993#M28341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-09T15:33:35Z</dc:date>
    </item>
  </channel>
</rss>

