<?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 a date column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157596#M17724</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As mr Kimball says:&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;To facilitate partitioning, the primary key of a date dimension can be more meaningful, such as an integer representing YYYYMMDD, instead of a sequentially-assigned surrogate key&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/calendar-date-dimension/" target="_blank"&gt;https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/calendar-date-dimension/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So go to modelling -&amp;gt; new table -&amp;gt; and insert the code I shared earlier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jun 2020 09:04:42 GMT</pubDate>
    <dc:creator>stevedep</dc:creator>
    <dc:date>2020-06-14T09:04:42Z</dc:date>
    <item>
      <title>Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156000#M17657</link>
      <description>&lt;P&gt;I want to add a new column as a date index, which starts with 03 April 2018 or any particular date and goes on till the current date.&lt;BR /&gt;how to add this thing through DAX as a column.I got some DAX expression but all those creating a new table for it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:39:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156000#M17657</guid>
      <dc:creator>rohitchouhan</dc:creator>
      <dc:date>2020-06-12T14:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156195#M17659</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="235382" data-lia-user-login="rohitchouhan" class="lia-mention lia-mention-user"&gt;rohitchouhan&lt;/a&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;Your requirement is not very clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you want an index column against the date. i.e 1 for Dates 3rd April, 2 for Dates 4th April and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If so, please see this&amp;nbsp;&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Getting-Previous-Values-in-Power-BI-Part-1/ba-p/1143370" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Getting-Previous-Values-in-Power-BI-Part-1/ba-p/1143370&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Go to the section for creating a index column using rankx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:45:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156195#M17659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-12T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156196#M17660</link>
      <description>&lt;P&gt;If you are looking to create a data table with an integer as your key. You perhaps don't need an index key. Just join on the date integer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date =
ADDCOLUMNS (
CALENDAR (DATE(2018;4;1); DATE(2025;12;31));
"DateAsInteger"; FORMAT ( [Date]; "YYYYMMDD" );
"Year"; YEAR ( [Date] );
"Monthnumber"; FORMAT ( [Date]; "MM" );
"YearMonthnumber"; FORMAT ( [Date]; "YYYY/MM" );
"YearMonthShort"; FORMAT ( [Date]; "YYYY/mmm" );
"MonthNameShort"; FORMAT ( [Date]; "mmm" );
"MonthNameLong"; FORMAT ( [Date]; "mmmm" );
"DayOfWeekNumber"; WEEKDAY ( [Date] );
"DayOfWeek"; FORMAT ( [Date]; "dddd" );
"DayOfWeekShort"; FORMAT ( [Date]; "ddd" );
"Quarter"; "Q" &amp;amp; FORMAT ( [Date]; "Q" );
"YearQuarter"; FORMAT ( [Date]; "YYYY" ) &amp;amp; "/Q" &amp;amp; FORMAT ( [Date]; "Q" )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mind the data as integer colomn.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please mark as solution if this helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:45:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156196#M17660</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-12T15:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156198#M17661</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;, we responded almost at the same time &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:46:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1156198#M17661</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-12T15:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157149#M17697</link>
      <description>&lt;P&gt;Hello, thanks for the prompt reply,&lt;BR /&gt;i just want to add a column in my current table which starts from a particular date and goes on till today's date.&lt;BR /&gt;just like the calendar.I used some DAX but all those creating a separate table, not adding column to expecting table&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 15:38:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157149#M17697</guid>
      <dc:creator>rohitchouhan</dc:creator>
      <dc:date>2020-06-13T15:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157150#M17698</link>
      <description>&lt;P&gt;Hello, thanks for the prompt reply,&lt;BR /&gt;i just want to add a column in my current table which starts from a particular date and goes on till today's date.&lt;BR /&gt;just like the calendar.I used some DAX but all those creating a separate table, not adding column to expecting table&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 15:39:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157150#M17698</guid>
      <dc:creator>rohitchouhan</dc:creator>
      <dc:date>2020-06-13T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157167#M17699</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="235382" data-lia-user-login="rohitchouhan" class="lia-mention lia-mention-user"&gt;rohitchouhan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create an Index Column in Power Query.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 16:02:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157167#M17699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-13T16:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157472#M17713</link>
      <description>&lt;P&gt;Please try this expression in your calculated column.&amp;nbsp; It should count from 1 to today starting with the minimum date in the table.&amp;nbsp; Note you will have duplicated values where you have duplicate days (so not really an "index").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Day Number = var mindate = MIN(Table[Created Date Time)&amp;nbsp; // or you could hard code it with DATE(2018,4,3)&lt;/P&gt;&lt;P&gt;Return DATEDIFF(mindate, Table[Created Date Time], DAY) +1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 01:31:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157472#M17713</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-06-14T01:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157596#M17724</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As mr Kimball says:&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;To facilitate partitioning, the primary key of a date dimension can be more meaningful, such as an integer representing YYYYMMDD, instead of a sequentially-assigned surrogate key&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/calendar-date-dimension/" target="_blank"&gt;https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/calendar-date-dimension/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So go to modelling -&amp;gt; new table -&amp;gt; and insert the code I shared earlier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 09:04:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-date-column/m-p/1157596#M17724</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-14T09:04:42Z</dc:date>
    </item>
  </channel>
</rss>

