<?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 to calculate sum for same period for defined year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1973440#M43390</link>
    <description>&lt;P&gt;this worked perfectly - thank you!!&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jul 2021 13:27:24 GMT</pubDate>
    <dc:creator>hp0655</dc:creator>
    <dc:date>2021-07-22T13:27:24Z</dc:date>
    <item>
      <title>DAX to calculate sum for same period for defined year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1962812#M42963</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Does anyone know how to create a measure/variable that would calculate the sum for a defined year, while still keeping the month filters applied? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Phrased another way, I want to do "year-over-year" comparisons for each month in 2020 and 2021, but I want to compare them all to the same month in 2019 (i.e., pre-covid) rather than the previous year. So it would calculate the growth between, e.g., July 2020 vs July 2019, and between June 2021 vs. June 2019, etc.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 18:17:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1962812#M42963</guid>
      <dc:creator>hp0655</dc:creator>
      <dc:date>2021-07-16T18:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate sum for same period for defined year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1962963#M42976</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Comparison to Base Year] =
// The Year column in your calendar
// must be an integer for this to
// work.
var CurrentYear = SELECTEDVALUE( YourCalendar[Year] )
// Change this setting if you want to make
// any other year the base one. You can even
// have a slicer with years (disconnected table)
// that will tell this measure which year to
// use as the base. You would harvest the value
// of the Base Year from the slicer and use here.
// For the time being it's hard-coded, of course.
var BaseYear = 2019
var Result =
	if( NOT ISBLANK( CurrentYear ),
		var YearsToGoBack = BaseYear - CurrentYear
		var CurrentValue = [YourMeasure]
		var BaseYearValue =
			CALCULATE(
				[YourMeasure],
				DATEADD(
					'YourCalendar'[Date],
					YearsToGoBack,
					YEAR
				)
			)
		var Growth_ = 
			DIVIDE(
				CurrentValue - BaseYearValue,
				BaseYearValue
			)
		return
			Growth_
	)
return
	Result&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Jul 2021 20:48:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1962963#M42976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-16T20:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate sum for same period for defined year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1973440#M43390</link>
      <description>&lt;P&gt;this worked perfectly - thank you!!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 13:27:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-sum-for-same-period-for-defined-year/m-p/1973440#M43390</guid>
      <dc:creator>hp0655</dc:creator>
      <dc:date>2021-07-22T13:27:24Z</dc:date>
    </item>
  </channel>
</rss>

