<?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 Percentage Difference Between Quarters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1956891#M42714</link>
    <description>&lt;P&gt;A lot of text.... but where's the problem? 'Cause I can't see anything clearly pointing out the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This piece of code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;VAR CurrentQTRCosts = SUM(EBSOptimization[CostAvoidance])&lt;/LI-CODE&gt;&lt;P&gt;will only sum up values that are visible in the current context. It will not auto-magically give you a quarter's value. So, if you select a period of time from your Calendar that happens to be a full quarter, the measures will work correctly. If you select something different, they won't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this the problem here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On top of that, time-intel functions work correctly when you use them on a proper Calendar, not when you want to use them with any column in any table.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 09:26:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-14T09:26:26Z</dc:date>
    <item>
      <title>Calculate Percentage Difference Between Quarters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1955495#M42680</link>
      <description>&lt;P&gt;HI All, I am trying to calculate the percentage cost difference between 2 quarters. I am able to calculater a percentage costs difference between 2 months, but the quarters I cannot seem to find a solution. I have a table that includes the following fields Dates, EBSCostAvoidance column with costs that will be used to calculate the cost difference between the dates for the quarter percentage difference. I also have a QTR and Year column in this same table that I added trying to get the quarter percentages to work. I need for the percentage to display in a card visualization so that I can use unichar arrows for the up and down percentages. I do not need help with the unichar arrows as I have done this with the percentage changes for 2 months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have a Calendar table that has a date column, QTR and Year Column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example table with data for cost percentage calculation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Example Calendar table data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code that I have for Quarter percentages:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CustomAvoidanceTotalForPreviousQuarter =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(EBSOptimization[CostAvoidance])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, PREVIOUSQUARTER(EBSOptimization[Dates])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--- I have also changed the code above to look at the Calendar Dates field&amp;nbsp;PREVIOUSQUARTER(EBSOptimization[Dates])&lt;/P&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;P&gt;PREVIOUSQUARTER(Calendar[Date])&lt;/P&gt;&lt;P&gt;thinking it may help with locating the quarter. but that did not resolve the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CustomAvoidanceCostDifferenceQTR =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;VAR CurrentQTRCosts = SUM(EBSOptimization[CostAvoidance])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;VAR PreviousQTRCosts = [CustomAvoidanceTotalForPreviousQuarter]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;VAR Result = CurrentQTRCosts - PreviousQTRCosts&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;RETURN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CustomPercentageOfChangeQTR =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIVIDE([CustomAvoidanceCostDifferenceQTR],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [CustomAvoidanceTotalForPreviousQuarter]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on how I can figure percentage change between 2 quarters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 20:06:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1955495#M42680</guid>
      <dc:creator>lisamb1</dc:creator>
      <dc:date>2021-07-13T20:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage Difference Between Quarters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1956891#M42714</link>
      <description>&lt;P&gt;A lot of text.... but where's the problem? 'Cause I can't see anything clearly pointing out the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This piece of code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;VAR CurrentQTRCosts = SUM(EBSOptimization[CostAvoidance])&lt;/LI-CODE&gt;&lt;P&gt;will only sum up values that are visible in the current context. It will not auto-magically give you a quarter's value. So, if you select a period of time from your Calendar that happens to be a full quarter, the measures will work correctly. If you select something different, they won't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this the problem here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On top of that, time-intel functions work correctly when you use them on a proper Calendar, not when you want to use them with any column in any table.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 09:26:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1956891#M42714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-14T09:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage Difference Between Quarters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1957402#M42737</link>
      <description>&lt;P&gt;daxer thank you for your assistance I am still learning Power BI and this did resolve the issue. I thought the CurrentQTRCosts and PreviousQTRCosts would identify the quarters, but after your explanation I did go pick a full quarter and that did resolve the issue of the percentage not displaying correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Per your suggestion I will change the code to look at my Calendar table instead of the date in my data table. I was not aware of time-intel functions not working correctly if I did not use the Calendar table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 12:46:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Difference-Between-Quarters/m-p/1957402#M42737</guid>
      <dc:creator>lisamb1</dc:creator>
      <dc:date>2021-07-14T12:46:38Z</dc:date>
    </item>
  </channel>
</rss>

