<?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 Using two date dimensions not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-two-date-dimensions-not-working/m-p/3214361#M117332</link>
    <description>&lt;P&gt;I want to have a graph with two lines showing sales data from the prior and current year.&amp;nbsp; &amp;nbsp;I want one line to just be a straight line across which is the prior year sales multiplied by a fixed number representing a percent increase.&amp;nbsp; The other line will be the&amp;nbsp; cumulative sales to date by month for the current year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The report has a table which shows the current year-to-date Average Daily Sales, and&amp;nbsp;the prior year-to-date Average Daily Sales as of the same month in the prior year.&amp;nbsp; &amp;nbsp;Users can select a month from a date slicer, based on the date dimension DIM_PERIOD_GL_DATE, in order to view cumulative sales data as of the selected month in the current and prior years.&amp;nbsp; For example sales data through April of the current year and April of last year, February of the current year and last year etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want the graph to be affected by which month is selected in the slicer.&amp;nbsp; I created a second date dimension DIM_PERIOD_GL_DATE2 to be used by the graph and defined a measure like this for the straight line showing the prior year sales with a 3% increase:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;CFY Sales Goal = var yr = CALCULATE( &lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;MAX(DIM_PERIOD_GL_DATE2[FISC_YR_NUM]), &lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;FILTER( ALL(DIM_PERIOD_GL_DATE2),DIM_PERIOD_GL_DATE2[Date] = TODAY()-1)&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var pysls = CALCULATE(&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;FACT_SLS[Sales AMT], FILTER( ALL(DIM_PERIOD_GL_DATE2),DIM_PERIOD_GL_DATE2[FISC_YR_NUM] = yr-1 )&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return pysls*1.03&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I select a month from the slicer that uses&amp;nbsp;DIM_PERIOD_GL_DATE it is&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Changing the value of CFY Sales Goal in the visual&lt;/LI&gt;&lt;LI&gt;Shows a value only for the selected month even though the date in the visual is from DIM_PERIOD_GL_DATE2.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Even if the measure was based on&amp;nbsp;DIM_PERIOD_GL_DATE selecting a month shouldn't change the value of the measure.&amp;nbsp; As expected the value doesn't change when I select various months from a slicer that uses&amp;nbsp;DIM_PERIOD_GL_DATE2 (as long a month from the current year is selected).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is the date slicer that uses DIM_PERIOD_GL_DATE affecting the visual?&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 20:31:02 GMT</pubDate>
    <dc:creator>gspollock</dc:creator>
    <dc:date>2023-05-01T20:31:02Z</dc:date>
    <item>
      <title>Using two date dimensions not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-two-date-dimensions-not-working/m-p/3214361#M117332</link>
      <description>&lt;P&gt;I want to have a graph with two lines showing sales data from the prior and current year.&amp;nbsp; &amp;nbsp;I want one line to just be a straight line across which is the prior year sales multiplied by a fixed number representing a percent increase.&amp;nbsp; The other line will be the&amp;nbsp; cumulative sales to date by month for the current year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The report has a table which shows the current year-to-date Average Daily Sales, and&amp;nbsp;the prior year-to-date Average Daily Sales as of the same month in the prior year.&amp;nbsp; &amp;nbsp;Users can select a month from a date slicer, based on the date dimension DIM_PERIOD_GL_DATE, in order to view cumulative sales data as of the selected month in the current and prior years.&amp;nbsp; For example sales data through April of the current year and April of last year, February of the current year and last year etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want the graph to be affected by which month is selected in the slicer.&amp;nbsp; I created a second date dimension DIM_PERIOD_GL_DATE2 to be used by the graph and defined a measure like this for the straight line showing the prior year sales with a 3% increase:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;CFY Sales Goal = var yr = CALCULATE( &lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;MAX(DIM_PERIOD_GL_DATE2[FISC_YR_NUM]), &lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;FILTER( ALL(DIM_PERIOD_GL_DATE2),DIM_PERIOD_GL_DATE2[Date] = TODAY()-1)&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var pysls = CALCULATE(&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;FACT_SLS[Sales AMT], FILTER( ALL(DIM_PERIOD_GL_DATE2),DIM_PERIOD_GL_DATE2[FISC_YR_NUM] = yr-1 )&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return pysls*1.03&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I select a month from the slicer that uses&amp;nbsp;DIM_PERIOD_GL_DATE it is&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Changing the value of CFY Sales Goal in the visual&lt;/LI&gt;&lt;LI&gt;Shows a value only for the selected month even though the date in the visual is from DIM_PERIOD_GL_DATE2.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Even if the measure was based on&amp;nbsp;DIM_PERIOD_GL_DATE selecting a month shouldn't change the value of the measure.&amp;nbsp; As expected the value doesn't change when I select various months from a slicer that uses&amp;nbsp;DIM_PERIOD_GL_DATE2 (as long a month from the current year is selected).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is the date slicer that uses DIM_PERIOD_GL_DATE affecting the visual?&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 20:31:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-two-date-dimensions-not-working/m-p/3214361#M117332</guid>
      <dc:creator>gspollock</dc:creator>
      <dc:date>2023-05-01T20:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using two date dimensions not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-two-date-dimensions-not-working/m-p/3214764#M117351</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your questions would be much easier to answer if you provided your pbix file (or at least a sample sanitized version). &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 02:57:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-two-date-dimensions-not-working/m-p/3214764#M117351</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2023-05-02T02:57:38Z</dc:date>
    </item>
  </channel>
</rss>

