<?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: Calculate period over period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3541296#M136080</link>
    <description>&lt;LI-CODE lang="markup"&gt;I'm trying to calculate and compare two measures.&lt;/LI-CODE&gt;
&lt;P&gt;You cannot measure a measure. Implement your business logic in a single measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data (with sensitive information removed) that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot). Leave out anything not related to the issue. &lt;BR /&gt;If you are unsure how to do that please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;If you want to get answers faster please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 19 Nov 2023 23:50:30 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-11-19T23:50:30Z</dc:date>
    <item>
      <title>Calculate period over period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3540153#M136044</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I'm trying to calculate and compare two measures.&lt;/P&gt;&lt;P&gt;The first "Qty Sum" is the SUM of my fact table on a period defined by a "between" date sclicer and the second is the same measure on the previous period (Qty Sum PP).&lt;/P&gt;&lt;P&gt;For example, if the period is from 11/13/2023 to 11/19/2023 (7 days), I would like to calculate the second measure as the sum on the previous period i.e. 11/06/2023 to 11/12/2023.&lt;/P&gt;&lt;P&gt;If the user selects another period, the measure have to calculate the length of the period and returns the sum of my fact table on this period.&lt;/P&gt;&lt;P&gt;My date table is named "Dates". My fact table is named Facts with a column Date and a column Qty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first measure is "Qty Sum" defined as :&lt;/P&gt;&lt;P&gt;Qty Sum =&lt;BR /&gt;SUM(Facts[Qty])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second measure is :&lt;/P&gt;&lt;P&gt;Qty Sum PP =&lt;BR /&gt;VAR PeriodEnd = FIRSTDATE('Dates'[Date])-1&lt;BR /&gt;VAR PeriodStart =&lt;BR /&gt;PeriodEnd -&lt;BR /&gt;DATEDIFF(&lt;BR /&gt;FIRSTDATE('Dates'[Date]),&lt;BR /&gt;LASTDATE('Dates'[Date]),&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;VAR Result =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Qty Sum],&lt;BR /&gt;DATESBETWEEN('Dates'[Date],&lt;BR /&gt;PeriodStart,PeriodEnd&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;Return Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second measure does not work. It returns blank.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2023 10:11:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3540153#M136044</guid>
      <dc:creator>echaize</dc:creator>
      <dc:date>2023-11-18T10:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate period over period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3541296#M136080</link>
      <description>&lt;LI-CODE lang="markup"&gt;I'm trying to calculate and compare two measures.&lt;/LI-CODE&gt;
&lt;P&gt;You cannot measure a measure. Implement your business logic in a single measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data (with sensitive information removed) that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot). Leave out anything not related to the issue. &lt;BR /&gt;If you are unsure how to do that please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;If you want to get answers faster please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2023 23:50:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3541296#M136080</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-11-19T23:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate period over period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3541760#M136110</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;provides the solution in this post :&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Calculate-period-over-period/td-p/3540117" target="_self"&gt;https://community.fabric.microsoft.com/t5/Desktop/Calculate-period-over-period/td-p/3540117&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 07:10:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-period-over-period/m-p/3541760#M136110</guid>
      <dc:creator>echaize</dc:creator>
      <dc:date>2023-11-20T07:10:50Z</dc:date>
    </item>
  </channel>
</rss>

