<?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: Relationship not getting created in a date table in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1819659#M29271</link>
    <description>&lt;P&gt;If MONTH(&amp;nbsp;&lt;SPAN&gt;dateincurrenttable&amp;nbsp;) is 1, then&amp;nbsp;MONTH(&amp;nbsp;dateincurrenttable&amp;nbsp;) - 1 = 0 and this is not allowed in DATE. Also, months do not have the same number of days, so if you happen to have a month with 31 days and the previous only had 30... then the DATE can't be created. There are many &lt;STRONG&gt;other&lt;/STRONG&gt; issues with your approach (but I don't have time to explain them right now) so I'd kindly suggest you should abandon this way of coding. Please look for something more robust: &lt;STRONG&gt;time-intel functions&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 May 2021 10:55:13 GMT</pubDate>
    <dc:creator>daxer-almighty</dc:creator>
    <dc:date>2021-05-03T10:55:13Z</dc:date>
    <item>
      <title>Relationship not getting created in a date table</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1818414#M29259</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with the latest sales for today.&amp;nbsp; Now, i want to go back and fetch the sales for 1 month back, 2 months back likewise upto 6 months back.&amp;nbsp; However, the previous data is available in a different fact table.&amp;nbsp; I have a separte date dimension table which is connected to both the fact table.&amp;nbsp; When i am going one - six months back, since the date has to be customized based on the availability of the sales, i am using the function&amp;nbsp; as follows :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR dateincurrenttable =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max (Currentday_latest[Last Updated])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR date1monthbefore_0 =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;DATE ( YEAR ( dateincurrenttable ), MONTH ( dateincurrenttable ) - 1, DAY ( dateincurrenttable ) )&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;date1monthbefore_0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, when i pull the date from the date dimension table,&lt;/SPAN&gt;&lt;SPAN&gt; i am getting an error message saying :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;An Argument of Function Date has wrong data type or result is too small or too large&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But the date1monthbefore_0 is coming in the date format and also the result is correct.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I even tried using treatas function for the date table and the currentday_latest table.&amp;nbsp; However, nothing seems to work.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Padmaja&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 02 May 2021 10:52:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1818414#M29259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-02T10:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Relationship not getting created in a date table</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1819659#M29271</link>
      <description>&lt;P&gt;If MONTH(&amp;nbsp;&lt;SPAN&gt;dateincurrenttable&amp;nbsp;) is 1, then&amp;nbsp;MONTH(&amp;nbsp;dateincurrenttable&amp;nbsp;) - 1 = 0 and this is not allowed in DATE. Also, months do not have the same number of days, so if you happen to have a month with 31 days and the previous only had 30... then the DATE can't be created. There are many &lt;STRONG&gt;other&lt;/STRONG&gt; issues with your approach (but I don't have time to explain them right now) so I'd kindly suggest you should abandon this way of coding. Please look for something more robust: &lt;STRONG&gt;time-intel functions&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 10:55:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1819659#M29271</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-05-03T10:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Relationship not getting created in a date table</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1820321#M29278</link>
      <description>&lt;P&gt;Thanks Daxer.&amp;nbsp; Yes, i understand the issues. and i worked out on multiple options but without any solutoin except that i get the result but i need to create different measures and just show the data in the card format.&amp;nbsp; &amp;nbsp;i was trying to show the data as bar graph with dates as axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tahnks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 17:17:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1820321#M29278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-03T17:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Relationship not getting created in a date table</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1823775#M29293</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In other words, you want to get the sales data of the previous month, but the sales data of the previous month are in another fact table, so you need to create a date column, right?&lt;/P&gt;
&lt;P&gt;Maybe you can use the "Append Queries" feature to merge the two fact tables.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="v-lionel-msft_0-1620191699146.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/507960i7E6BDA51D1CBC218/image-size/medium?v=v2&amp;amp;px=400" role="button" title="v-lionel-msft_0-1620191699146.png" alt="v-lionel-msft_0-1620191699146.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Lionel Chen&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 05:23:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Relationship-not-getting-created-in-a-date-table/m-p/1823775#M29293</guid>
      <dc:creator>v-lionel-msft</dc:creator>
      <dc:date>2021-05-05T05:23:25Z</dc:date>
    </item>
  </channel>
</rss>

