<?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: Best Practice for Creating Optimized Date Dimension Table (Including Fiscal Year: April–March)  Post in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773595#M182811</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1312712" data-lia-user-login="GanesaMoorthyGM" class="lia-mention lia-mention-user"&gt;GanesaMoorthyGM&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We can create using Power Query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below M code&amp;nbsp;&lt;BR /&gt;Dynamically generating&amp;nbsp;&lt;STRONG data-start="55" data-end="79"&gt;Date Dimension table&lt;/STRONG&gt; based on the &lt;STRONG data-start="93" data-end="135"&gt;min and max dates from Table&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let&lt;BR /&gt;// Reference your table&lt;BR /&gt;Source = Table, // Name of the table from where min and max date to be taken.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Get the minimum and maximum dates from your fact table's date column&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MinDate&lt;/STRONG&gt; &lt;/EM&gt;= List.Min(Source[OrderDate]),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MaxDate&lt;/STRONG&gt; &lt;/EM&gt;= List.Max(Source[OrderDate]),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Generate date range list&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DateList&lt;/STRONG&gt; &lt;/EM&gt;= List.Dates(MinDate, Duration.Days(MaxDate - MinDate) + 1, #duration(1, 0, 0, 0)),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DateTable&lt;/STRONG&gt; &lt;/EM&gt;= Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Adding Columns&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddDay&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(DateTable, "Day", each Date.Day([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddMonthNum&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddDay, "Month Number", each Date.Month([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddMonthName&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddMonthNum, "Month Name", each Date.ToText([Date], "MMMM"), type text),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddMonthOrder&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddMonthName, "Month Order", each Date.Month([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddQuarter&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddMonthOrder, "Quarter", each Date.QuarterOfYear([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddQuarterName&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddQuarter, "Quarter Name", each "Q" &amp;amp; Number.ToText(Date.QuarterOfYear([Date])), type text),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddYear&lt;/EM&gt; &lt;/STRONG&gt;= Table.AddColumn(AddQuarterName, "Year", each Date.Year([Date]), Int64.Type),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddWeekNum&lt;/EM&gt;&lt;/STRONG&gt; = Table.AddColumn(AddYear, "Week Number", each Date.WeekOfYear([Date]), Int64.Type),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddDayOfWeek&lt;/EM&gt;&lt;/STRONG&gt; = Table.AddColumn(AddWeekNum, "Day of Week", each Date.DayOfWeek([Date]), Int64.Type),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddWeekdayName&lt;/EM&gt;&lt;/STRONG&gt; = Table.AddColumn(AddDayOfWeek, "Weekday Name", each Date.ToText([Date], "dddd"), type text),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Fiscal Year (April to March)&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddFiscalYear&lt;/STRONG&gt;&lt;/EM&gt; = Table.AddColumn(AddWeekdayName, "Fiscal Year", each &lt;BR /&gt;let&lt;BR /&gt;year = Date.Year([Date]),&lt;BR /&gt;month = Date.Month([Date])&lt;BR /&gt;in &lt;BR /&gt;if month &amp;gt;= 4 then Text.From(year) &amp;amp; "-" &amp;amp; Text.End(Text.From(year + 1), 2) &lt;BR /&gt;else Text.From(year - 1) &amp;amp; "-" &amp;amp; Text.End(Text.From(year), 2),&lt;BR /&gt;type text),&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;AddFiscalQuarter&lt;/STRONG&gt;&lt;/EM&gt; = Table.AddColumn(AddFiscalYear, "Fiscal Quarter", each &lt;BR /&gt;let&lt;BR /&gt;month = Date.Month([Date])&lt;BR /&gt;in &lt;BR /&gt;if month &amp;gt;= 4 and month &amp;lt;= 6 then "Q1"&lt;BR /&gt;else if month &amp;gt;= 7 and month &amp;lt;= 9 then "Q2"&lt;BR /&gt;else if month &amp;gt;= 10 and month &amp;lt;= 12 then "Q3"&lt;BR /&gt;else "Q4", type text)&lt;/P&gt;
&lt;P&gt;in&lt;BR /&gt;AddFiscalQuarter&lt;/P&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;H1&gt;&lt;STRONG&gt;If this answers your questions, kindly accept it as a solution and give kudos&lt;/STRONG&gt;&lt;/H1&gt;</description>
    <pubDate>Wed, 23 Jul 2025 11:15:40 GMT</pubDate>
    <dc:creator>mdaatifraza5556</dc:creator>
    <dc:date>2025-07-23T11:15:40Z</dc:date>
    <item>
      <title>Best Practice for Creating Optimized Date Dimension Table (Including Fiscal Year: April–March)  Post</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773560#M182808</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm working on building a &lt;STRONG&gt;Date Dimension table&lt;/STRONG&gt; for my Power BI model and would appreciate your suggestions on the &lt;STRONG&gt;best practices and an optimized query&lt;/STRONG&gt; to generate it.&lt;/P&gt;&lt;P&gt;Here's what I'm looking for in the Date table:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Date&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Day&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Month Number&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Month Name&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Month Order (for sorting)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Quarter&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Quarter Name&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Year&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Fiscal Year&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Fiscal Quarter&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Week Number&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Day of Week / Weekday Name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":backhand_index_pointing_right:"&gt;👉&lt;/span&gt; &lt;STRONG&gt;Important Note:&lt;/STRONG&gt; Our &lt;STRONG&gt;Fiscal Year starts in April and ends in March&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I’m aiming to these for&amp;nbsp;performance and scalability are important, so an optimized approach would be ideal.&lt;/P&gt;&lt;P&gt;If anyone has a tried-and-tested query (especially one handling fiscal logic cleanly), or tips on calculated columns/transformations for this, please share. It would be really helpful for me and others facing the same use case.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;HR /&gt;</description>
      <pubDate>Wed, 23 Jul 2025 10:49:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773560#M182808</guid>
      <dc:creator>GanesaMoorthyGM</dc:creator>
      <dc:date>2025-07-23T10:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice for Creating Optimized Date Dimension Table (Including Fiscal Year: April–March)  Post</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773595#M182811</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1312712" data-lia-user-login="GanesaMoorthyGM" class="lia-mention lia-mention-user"&gt;GanesaMoorthyGM&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We can create using Power Query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below M code&amp;nbsp;&lt;BR /&gt;Dynamically generating&amp;nbsp;&lt;STRONG data-start="55" data-end="79"&gt;Date Dimension table&lt;/STRONG&gt; based on the &lt;STRONG data-start="93" data-end="135"&gt;min and max dates from Table&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let&lt;BR /&gt;// Reference your table&lt;BR /&gt;Source = Table, // Name of the table from where min and max date to be taken.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Get the minimum and maximum dates from your fact table's date column&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MinDate&lt;/STRONG&gt; &lt;/EM&gt;= List.Min(Source[OrderDate]),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MaxDate&lt;/STRONG&gt; &lt;/EM&gt;= List.Max(Source[OrderDate]),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Generate date range list&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DateList&lt;/STRONG&gt; &lt;/EM&gt;= List.Dates(MinDate, Duration.Days(MaxDate - MinDate) + 1, #duration(1, 0, 0, 0)),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DateTable&lt;/STRONG&gt; &lt;/EM&gt;= Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Adding Columns&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddDay&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(DateTable, "Day", each Date.Day([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddMonthNum&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddDay, "Month Number", each Date.Month([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddMonthName&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddMonthNum, "Month Name", each Date.ToText([Date], "MMMM"), type text),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddMonthOrder&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddMonthName, "Month Order", each Date.Month([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddQuarter&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddMonthOrder, "Quarter", each Date.QuarterOfYear([Date]), Int64.Type),&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddQuarterName&lt;/STRONG&gt; &lt;/EM&gt;= Table.AddColumn(AddQuarter, "Quarter Name", each "Q" &amp;amp; Number.ToText(Date.QuarterOfYear([Date])), type text),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddYear&lt;/EM&gt; &lt;/STRONG&gt;= Table.AddColumn(AddQuarterName, "Year", each Date.Year([Date]), Int64.Type),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddWeekNum&lt;/EM&gt;&lt;/STRONG&gt; = Table.AddColumn(AddYear, "Week Number", each Date.WeekOfYear([Date]), Int64.Type),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddDayOfWeek&lt;/EM&gt;&lt;/STRONG&gt; = Table.AddColumn(AddWeekNum, "Day of Week", each Date.DayOfWeek([Date]), Int64.Type),&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;AddWeekdayName&lt;/EM&gt;&lt;/STRONG&gt; = Table.AddColumn(AddDayOfWeek, "Weekday Name", each Date.ToText([Date], "dddd"), type text),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Fiscal Year (April to March)&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;AddFiscalYear&lt;/STRONG&gt;&lt;/EM&gt; = Table.AddColumn(AddWeekdayName, "Fiscal Year", each &lt;BR /&gt;let&lt;BR /&gt;year = Date.Year([Date]),&lt;BR /&gt;month = Date.Month([Date])&lt;BR /&gt;in &lt;BR /&gt;if month &amp;gt;= 4 then Text.From(year) &amp;amp; "-" &amp;amp; Text.End(Text.From(year + 1), 2) &lt;BR /&gt;else Text.From(year - 1) &amp;amp; "-" &amp;amp; Text.End(Text.From(year), 2),&lt;BR /&gt;type text),&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;AddFiscalQuarter&lt;/STRONG&gt;&lt;/EM&gt; = Table.AddColumn(AddFiscalYear, "Fiscal Quarter", each &lt;BR /&gt;let&lt;BR /&gt;month = Date.Month([Date])&lt;BR /&gt;in &lt;BR /&gt;if month &amp;gt;= 4 and month &amp;lt;= 6 then "Q1"&lt;BR /&gt;else if month &amp;gt;= 7 and month &amp;lt;= 9 then "Q2"&lt;BR /&gt;else if month &amp;gt;= 10 and month &amp;lt;= 12 then "Q3"&lt;BR /&gt;else "Q4", type text)&lt;/P&gt;
&lt;P&gt;in&lt;BR /&gt;AddFiscalQuarter&lt;/P&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;H1&gt;&lt;STRONG&gt;If this answers your questions, kindly accept it as a solution and give kudos&lt;/STRONG&gt;&lt;/H1&gt;</description>
      <pubDate>Wed, 23 Jul 2025 11:15:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773595#M182811</guid>
      <dc:creator>mdaatifraza5556</dc:creator>
      <dc:date>2025-07-23T11:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice for Creating Optimized Date Dimension Table (Including Fiscal Year: April–March)  Post</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773605#M182812</link>
      <description>&lt;P&gt;Thanks for your quick response&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="921080" data-lia-user-login="mdaatifraza5556" class="lia-mention lia-mention-user"&gt;mdaatifraza5556&lt;/a&gt;.&lt;BR /&gt;I'll definitely give a try to this and will update here.&lt;BR /&gt;Thanks Again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2025 11:26:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4773605#M182812</guid>
      <dc:creator>GanesaMoorthyGM</dc:creator>
      <dc:date>2025-07-23T11:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice for Creating Optimized Date Dimension Table (Including Fiscal Year: April–March)  Post</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4774999#M182868</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1312712" data-lia-user-login="GanesaMoorthyGM" class="lia-mention lia-mention-user"&gt;GanesaMoorthyGM&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/P&gt;
&lt;P&gt;It looks like you are building a Date Dimension table for a Power BI model and is looking for best practices and an optimized Power Query (M) script to generate it. As&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="903292" data-lia-user-login="MasonMA" class="lia-mention lia-mention-user"&gt;MasonMA&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="921080" data-lia-user-login="mdaatifraza5556" class="lia-mention lia-mention-user"&gt;mdaatifraza5556&lt;/a&gt;&amp;nbsp;both responded to your query, kindly go through their responses and check if the issue can be resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also take a moment to thank &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="903292" data-lia-user-login="MasonMA" class="lia-mention lia-mention-user"&gt;MasonMA&lt;/a&gt;&amp;nbsp;and &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="921080" data-lia-user-login="mdaatifraza5556" class="lia-mention lia-mention-user"&gt;mdaatifraza5556&lt;/a&gt;, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Hammad.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 11:09:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-Practice-for-Creating-Optimized-Date-Dimension-Table/m-p/4774999#M182868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-07-24T11:09:54Z</dc:date>
    </item>
  </channel>
</rss>

