<?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: Different Values Depending On Date Hierarchy in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3949362#M153411</link>
    <description>&lt;P&gt;I had already tried this measure, but only had 1 single column in my Dates table with the Date Hierarchy instead of using 4 different columns. I thought it should be possible only with 1 but it seems like it doesn't work the way I thought.&lt;BR /&gt;This works indeed, so thank you!&lt;/P&gt;</description>
    <pubDate>Sat, 25 May 2024 13:29:05 GMT</pubDate>
    <dc:creator>GiorgosPap311</dc:creator>
    <dc:date>2024-05-25T13:29:05Z</dc:date>
    <item>
      <title>Different Values Depending On Date Hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3948552#M153381</link>
      <description>&lt;P&gt;I have a very easy (I suppose) question, but it's driving me crazy.&lt;BR /&gt;We have a table named "Dates" with 1 single column named "Date", let's say this one&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Dates =&lt;/SPAN&gt; &lt;SPAN&gt;CALENDAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"2020-01-01"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"2024-01-01"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I want to create a measure and plot it on a bar chart with the following rule.&lt;BR /&gt;&lt;BR /&gt;If the date hierarchy level selected is on Year level, then return 1&lt;BR /&gt;If the date hierarchy level selected is on Quarter level, then return 2&lt;BR /&gt;If the date hierarchy level selected is on Month level, then return 3&lt;BR /&gt;If the date hierarchy level selected is on Day level, then return 4&lt;BR /&gt;&lt;BR /&gt;The reason to do so, is that if I have a way to create that, then I also have a way, using VARs, to create a bar chart that will use&lt;BR /&gt;PREVIOUSYEAR, PREVIOUSQUARTER, ..... dynamically depending on the level I'm currently on.&lt;BR /&gt;&lt;BR /&gt;Thank you for your inputs&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 22:04:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3948552#M153381</guid>
      <dc:creator>GiorgosPap311</dc:creator>
      <dc:date>2024-05-24T22:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Different Values Depending On Date Hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3948730#M153389</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="749284" data-lia-user-login="GiorgosPap311" class="lia-mention lia-mention-user"&gt;GiorgosPap311&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can refer to below measure.&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;LI-CODE lang="markup"&gt;Measure = 
SWITCH(TRUE(),
    ISINSCOPE('Date'[Date]),    4 ,
    ISINSCOPE('Date'[Month]),   3 ,
    ISINSCOPE('Date'[Quarter]), 2 ,
    ISINSCOPE('Date'[Year]),    1
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&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;</description>
      <pubDate>Sat, 25 May 2024 03:53:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3948730#M153389</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-25T03:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Different Values Depending On Date Hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3949362#M153411</link>
      <description>&lt;P&gt;I had already tried this measure, but only had 1 single column in my Dates table with the Date Hierarchy instead of using 4 different columns. I thought it should be possible only with 1 but it seems like it doesn't work the way I thought.&lt;BR /&gt;This works indeed, so thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2024 13:29:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-Values-Depending-On-Date-Hierarchy/m-p/3949362#M153411</guid>
      <dc:creator>GiorgosPap311</dc:creator>
      <dc:date>2024-05-25T13:29:05Z</dc:date>
    </item>
  </channel>
</rss>

