<?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 Is is necessary for Date table to Mark as date for calculation ? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3563654#M137373</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know, is it necessary to mark a date table as Date, before using it for some calculation, for example to use it in SAMEPERIODLASTYER or PREVIOUSYEAR or DATEADD(date, -1, year) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I tried all those 3 DAX with my measure but all return wrongly, mostly blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have FactTable named FactInternetSales and it has column SalesAmount. The measure I created are:&lt;/P&gt;&lt;P&gt;Sales amount = SUM(FactInternetSales[SalesAmount])&lt;/P&gt;&lt;P&gt;Sales amount LY = CALCULATE([Sales amount], SAMEPERIODLASTYEAR(Dates[Date])) or&lt;/P&gt;&lt;P&gt;Sales amount LY = CALCULATE([Sales amount], PREVIOUSYEAR(Dates[Date])) or&lt;/P&gt;&lt;P&gt;Sales amount LY = CALCULATE([Sales amount], DATEADD(Dates[Date], -1, year))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the relationship is set between FactInternetSales[OrderDateKey] to Dates[DateKey]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it not working because I didn't mark the Dates table as Date ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 19:07:07 GMT</pubDate>
    <dc:creator>KenMann</dc:creator>
    <dc:date>2023-12-01T19:07:07Z</dc:date>
    <item>
      <title>Is is necessary for Date table to Mark as date for calculation ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3563654#M137373</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know, is it necessary to mark a date table as Date, before using it for some calculation, for example to use it in SAMEPERIODLASTYER or PREVIOUSYEAR or DATEADD(date, -1, year) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I tried all those 3 DAX with my measure but all return wrongly, mostly blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have FactTable named FactInternetSales and it has column SalesAmount. The measure I created are:&lt;/P&gt;&lt;P&gt;Sales amount = SUM(FactInternetSales[SalesAmount])&lt;/P&gt;&lt;P&gt;Sales amount LY = CALCULATE([Sales amount], SAMEPERIODLASTYEAR(Dates[Date])) or&lt;/P&gt;&lt;P&gt;Sales amount LY = CALCULATE([Sales amount], PREVIOUSYEAR(Dates[Date])) or&lt;/P&gt;&lt;P&gt;Sales amount LY = CALCULATE([Sales amount], DATEADD(Dates[Date], -1, year))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the relationship is set between FactInternetSales[OrderDateKey] to Dates[DateKey]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it not working because I didn't mark the Dates table as Date ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 19:07:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3563654#M137373</guid>
      <dc:creator>KenMann</dc:creator>
      <dc:date>2023-12-01T19:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is is necessary for Date table to Mark as date for calculation ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3563754#M137380</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="649034" data-lia-user-login="KenMann" class="lia-mention lia-mention-user"&gt;KenMann&lt;/a&gt;&amp;nbsp;Maybe, but those functions are terrible.&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also:&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/nUZPk7lpe_Q" data-video-remote-vid="https://youtu.be/nUZPk7lpe_Q" class="lia-video-container lia-media-is-center lia-media-size-small"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnUZPk7lpe_Q%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnUZPk7lpe_Q&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnUZPk7lpe_Q%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 21:21:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3563754#M137380</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-12-01T21:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is is necessary for Date table to Mark as date for calculation ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3570126#M137648</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="649034" data-lia-user-login="KenMann" class="lia-mention lia-mention-user"&gt;KenMann&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 09:36:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3570126#M137648</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-06T09:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is is necessary for Date table to Mark as date for calculation ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3577868#M137971</link>
      <description>&lt;P&gt;Hi Xiaoxin,&lt;/P&gt;&lt;P&gt;I would love to, but may I know how to change the storage mode to "Import" ?&lt;/P&gt;&lt;P&gt;I guess this is the way if we want to share the pbix, right ?&lt;/P&gt;&lt;P&gt;Currently it is on Mixed mode :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I total won't mind about the data since it is on AdventureWorks and I'm on learning basis in Fabric.&lt;/P&gt;&lt;P&gt;A further explanation, the data set is from OneLakeHub, and all the tables is on Direct Query Mode -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Btw, I currently did change my Date dimension to "Mark as date table", but the DAX calculation is still not working. As in previous message, I'm creating my 2 measures like this :&lt;/P&gt;&lt;P&gt;1. Sales amount = SUM(FactInternetSales[SalesAmount])&lt;/P&gt;&lt;P&gt;2. Sales amount LY = CALCULATE([Sales amount], SAMEPERIODLASTYEAR(Dates[Date])) or&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Sales amount LY = CALCULATE([Sales amount], PREVIOUSYEAR(Dates[Date])) or&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Sales amount LY = CALCULATE([Sales amount], DATEADD(Dates[Date], -1, year))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 15:31:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-is-necessary-for-Date-table-to-Mark-as-date-for-calculation/m-p/3577868#M137971</guid>
      <dc:creator>KenMann</dc:creator>
      <dc:date>2023-12-11T15:31:28Z</dc:date>
    </item>
  </channel>
</rss>

