<?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: Using a Date Hierarchy in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937222#M42150</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , when I give this formula, I corrected the position of the parenthesis. Make sure isincope is closed also calculate ending before next is in scope. &lt;/P&gt;</description>
    <pubDate>Mon, 05 Jul 2021 06:23:56 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-07-05T06:23:56Z</dc:date>
    <item>
      <title>Using a Date Hierarchy in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937042#M42143</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies in advance, I am very new to Power BI and still trying to learn as much as I can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to follow the example provided here:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=L2ELtem2iGY&amp;amp;t=213s," target="_blank"&gt;https://www.youtube.com/watch?v=L2ELtem2iGY&amp;amp;t=213s,&lt;/A&gt;&amp;nbsp;more specifically the code shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% Change = 
VAR CurrentValue = [Total Tickets]
VAR PreviousValue = 

SWITCH(
    TRUE(),
    ISINSCOPE('Date'[Date].[Day]), CALCULATE([Total Tickets]), DATEADD('Date'[Date], -1, DAY),
    ISINSCOPE('Date'[Date].[Month), CALCULATE([Total Tickets]), PARALLELPERIOD('Date'[Date], -1, MONTH),
    ISINSCOPE('Date'[Date].[Quarter], CALCULATE([Total Tickets]), PARALLELPERIOD('Date'[Date], -1, QUARTER),
    ISINSCOPE('Date'[Date].[Year], CALCULATE([Total Tickets]), PARALLELPERIOD('Date'[Date], -1, YEAR)
)
RETURN
DIVIDE(
    CurrentValue - PreviousValue,
    PreviousValue
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I am struggling to be able to create a Hierarchy in my Date table that allows me to use a hierarchy in the following way: 'Date'[Date].[Day]'. Basically, I am unable to select the hierarchy I created in my DAX expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Hierarchy I have created is pictured below, and I am aware that it is named differently from the example above, however, I am still unable to select it ('Date'.[Date Hierarchy].[Day] etc.).&lt;/P&gt;&lt;P&gt;&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;I have attempted to resolve this through multiple methods and none seem to work, so any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 05:08:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937042#M42143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-05T05:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Date Hierarchy in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937117#M42144</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You can direct columns? If need you can put them all in the slicer &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% Change = 
VAR CurrentValue = [Total Tickets]
VAR PreviousValue = 

SWITCH(
    TRUE(),
    ISINSCOPE('Date'[[Day]), CALCULATE([Total Tickets], DATEADD('Date'[Date], -1, DAY)),
    ISINSCOPE('Date'[Month), CALCULATE([Total Tickets], PARALLELPERIOD('Date'[Date], -1, MONTH)),
    ISINSCOPE('Date'[Quarter]), CALCULATE([Total Tickets], PARALLELPERIOD('Date'[Date], -1, QUARTER)),
    ISINSCOPE('Date'[Year]), CALCULATE([Total Tickets], PARALLELPERIOD('Date'[Date], -1, YEAR))
)
RETURN
DIVIDE(
    CurrentValue - PreviousValue,
    PreviousValue
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try if the above can work&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 05:48:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937117#M42144</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-07-05T05:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Date Hierarchy in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937128#M42146</link>
      <description>&lt;P&gt;Hey amitchandak,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried that before but I just get this error message instead:&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;Which I assumed meant there was an issue with the way I set up the date hierarchy, unless there is another reason?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 05:54:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937128#M42146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-05T05:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Date Hierarchy in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937222#M42150</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , when I give this formula, I corrected the position of the parenthesis. Make sure isincope is closed also calculate ending before next is in scope. &lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 06:23:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937222#M42150</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-07-05T06:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Date Hierarchy in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937286#M42153</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;my bad! I did not notice that. Just fixed it and it is now functioning as expected! Thank you so much for helping out, really appreciate it.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 06:47:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-Date-Hierarchy-in-DAX/m-p/1937286#M42153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-05T06:47:27Z</dc:date>
    </item>
  </channel>
</rss>

