<?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: Adding Calculated Column to Date Table based on Date Ranges in Another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365497#M173330</link>
    <description>&lt;P&gt;Thank you very much for your response. I have made an adjustement to my original code and have had success with the SELECTEDVALUE&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Semester Date = VAR _a =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
     CALCULATE(
        MAX('Semester Dates'[Academic Semester]),
        FILTER(
            'Semester Dates',
            [Date] &amp;gt;= 'Semester Dates'[Start] &amp;amp;&amp;amp;
            [Date] &amp;lt;= 'Semester Dates'[End]
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I aslo found some issues with the dates in my Semester Dates Table, which I have addressed and is working correctly now.&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2025 16:36:51 GMT</pubDate>
    <dc:creator>BeenBee</dc:creator>
    <dc:date>2025-01-15T16:36:51Z</dc:date>
    <item>
      <title>Adding Calculated Column to Date Table based on Date Ranges in Another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365392#M173322</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am looking for some help adding a column to my date table based on date start and end found in another table.&lt;/P&gt;&lt;P&gt;What I am trying to do is to add a column to my date table which specifies for each date in the table, which semester it falls into. The dates for each semester can be found in the Semester Date table. There is a start and end date for each semester.&lt;/P&gt;&lt;P&gt;I have tried to adapt the solution found in another post. The issue I am having is that the column is currently only returning the final semester found in the Semester Date table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX I have is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Semester Date = VAR _a =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    CALCULATE (
      MAX( 'Semester Dates'[Academic Semester]),
        FILTER (
            ALL ( 'Semester Dates' ),
            'Semester Dates'[Start]&amp;gt;= _a
                &amp;amp;&amp;amp; _a &amp;lt;= 'Semester Dates'[End]
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;Date Table;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Semester Date Table;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 15:23:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365392#M173322</guid>
      <dc:creator>BeenBee</dc:creator>
      <dc:date>2025-01-15T15:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Calculated Column to Date Table based on Date Ranges in Another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365459#M173327</link>
      <description>&lt;P&gt;SELECTEDVALUE won't work in a calculated column, you can use&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Semester Date = 
VAR _a = 'Date'[Date]
RETURN
    CALCULATE (
      MAX( 'Semester Dates'[Academic Semester]),
        FILTER (
            ALL ( 'Semester Dates' ),
            'Semester Dates'[Start]&amp;gt;= _a
                &amp;amp;&amp;amp; _a &amp;lt;= 'Semester Dates'[End]
        )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jan 2025 16:16:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365459#M173327</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-01-15T16:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Calculated Column to Date Table based on Date Ranges in Another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365497#M173330</link>
      <description>&lt;P&gt;Thank you very much for your response. I have made an adjustement to my original code and have had success with the SELECTEDVALUE&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Semester Date = VAR _a =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
     CALCULATE(
        MAX('Semester Dates'[Academic Semester]),
        FILTER(
            'Semester Dates',
            [Date] &amp;gt;= 'Semester Dates'[Start] &amp;amp;&amp;amp;
            [Date] &amp;lt;= 'Semester Dates'[End]
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I aslo found some issues with the dates in my Semester Dates Table, which I have addressed and is working correctly now.&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 16:36:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Calculated-Column-to-Date-Table-based-on-Date-Ranges-in/m-p/4365497#M173330</guid>
      <dc:creator>BeenBee</dc:creator>
      <dc:date>2025-01-15T16:36:51Z</dc:date>
    </item>
  </channel>
</rss>

