<?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: Sameperiodlastyear funcion issue in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729434#M1674</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, do you have a proper date table in your model that is designated as such and covers all FULL years for your date columns in any of your tables? If you don't, then time-BI functions will not work correctly. To me it looks like you're using time-BI functions without a proper date table. Might be wrong, of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2019 09:16:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-02T09:16:26Z</dc:date>
    <item>
      <title>Sameperiodlastyear funcion issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729147#M1662</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;I'm struggling with this one and couldn't find my way out&lt;/P&gt;&lt;P&gt;My goal is to show a Bar chart with current year months on X-axis, and monthly Sales of current/last year on values.&lt;/P&gt;&lt;P&gt;for that&amp;nbsp;I created a measure consists of the&amp;nbsp;SAMEPERIODLASTYEAR function (for last year values)&lt;/P&gt;&lt;P&gt;everything works fine but with one little bug:&lt;/P&gt;&lt;P&gt;On the 1st day of every month, the&amp;nbsp;SAMEPERIODLASTYEAR function returns the sales for a single day (the 1st of same month last year) instead of the entire month&lt;/P&gt;&lt;P&gt;from the second of the month and further, there is no problem.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;suppose last year daily sales equal to 100&lt;/P&gt;&lt;P&gt;here the results on 1/7/2019&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;here the results on 2/7/2019 and further:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;any ideas how to solve this?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 05:38:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729147#M1662</guid>
      <dc:creator>Adidas</dc:creator>
      <dc:date>2019-07-02T05:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiodlastyear funcion issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729434#M1674</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, do you have a proper date table in your model that is designated as such and covers all FULL years for your date columns in any of your tables? If you don't, then time-BI functions will not work correctly. To me it looks like you're using time-BI functions without a proper date table. Might be wrong, of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:16:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729434#M1674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-02T09:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiodlastyear funcion issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729734#M1701</link>
      <description>&lt;P&gt;Hi Darek&lt;/P&gt;&lt;P&gt;I do have a time dimension table generated by this Dax code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Date =
VAR BASECALENDAR =
    CALENDAR ( DATE ( 2009, 01, 01 ), TODAY () )
RETURN
    GENERATE (
        BASECALENDAR,
        VAR BASEDATE = [DATE]
        VAR YEARDATE =
            YEAR ( BASEDATE )
        VAR MONTHNUMBER =
            MONTH ( BASEDATE )
        VAR MONTHNAME =
            FORMAT ( BASEDATE, "MMMM" )
        VAR YEARMONTHNAME =
            FORMAT ( BASEDATE, "MMM-YY" )
        VAR YEARMONTHNUMBER = ( YEARDATE * 12 + MONTHNUMBER ) - 1
        RETURN
            ROW (
                "DAY", BASEDATE,
                "YEAR", YEARDATE,
                "MONTH NUMBER", MONTHNUMBER,
                "MONTH", MONTHNAME,
                "YEAR MONTH NUMBER", YEARMONTHNUMBER,
                "YEAR MONTH", YEARMONTHNAME
            )
    )&lt;/PRE&gt;&lt;P&gt;the sales fact table is linked to this dimension by inv date = dim date&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 13:36:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729734#M1701</guid>
      <dc:creator>Adidas</dc:creator>
      <dc:date>2019-07-02T13:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiodlastyear funcion issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729957#M1714</link>
      <description>&lt;P&gt;Why would you have cross-filter enabled on the relationship? What's the use of it? You should switch to one-way filtering from dim to the fact table and then see what happens.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 16:14:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/729957#M1714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-02T16:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiodlastyear funcion issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/730104#M1728</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I've built a demo model to isolate the problem,&lt;/P&gt;&lt;P&gt;it's one to one relationship so I'm forced to set both ways join&lt;/P&gt;&lt;P&gt;however, it has nothing to do with my issue since in the original model it's one-way join and still the same wrong calculation.&lt;/P&gt;&lt;P&gt;I'm starting to believe that Sameperiodlastyear function is context related and was design to work like this&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 19:37:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/730104#M1728</guid>
      <dc:creator>Adidas</dc:creator>
      <dc:date>2019-07-02T19:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiodlastyear funcion issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/730518#M1740</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the documentation of the function:&amp;nbsp;&lt;A href="https://dax.guide/sameperiodlastyear/" target="_blank"&gt;https://dax.guide/sameperiodlastyear/&lt;/A&gt;&amp;nbsp;as I don't know how I could be of any more help...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 07:56:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiodlastyear-funcion-issue/m-p/730518#M1740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-03T07:56:14Z</dc:date>
    </item>
  </channel>
</rss>

