<?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 returns an empty colum but with a correct total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036363#M103992</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="502727" data-lia-user-login="CertainlyMe" class="lia-mention lia-mention-user"&gt;CertainlyMe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAMEPERIODLASTYEAR is a time intelligence function that requires a proper date table with unique and contiguous date values. Create a date table snd create a relationship between the date table snd your table then you can use 'Date'[Date] in SAMEPERIODLASTYEAR&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 22 Jan 2023 18:56:44 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-01-22T18:56:44Z</dc:date>
    <item>
      <title>SamePeriodLastYear returns an empty colum but with a correct total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036353#M103991</link>
      <description>&lt;P&gt;Hi everyone &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First steps with Power BI here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on road accidents, trying to build a table to compare the number of accidents for every month of 2022 with the same month of 2021.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I work from a very simple table (Table_Accidents) that contains a line for every accident and elements on these accidents (date, place, type, etc.).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I did the following :&lt;/P&gt;&lt;P&gt;I made a DAX formula to count the number of lines, which is my total number of accidents :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nb_Accidents = COUNT(table_Accidents[#])&lt;/P&gt;&lt;P&gt;"#" being the name of the column where I just apply a different number to a new accident.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I wrote this formula :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Nb_accidents_Y-1 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(COUNT(table_Accidents[#])&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_Accidents&lt;/SPAN&gt;&lt;SPAN&gt;[date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I build a simple table with these two items, and I get close to where I want , except for my Y-1 column, the column is completely empty, but the total is here and correct (?!)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Same if I try with a SUM of accident costs, for instance: I get an empty column but with a correct total...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If anyone has a clue on this...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Have a nice day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 22 Jan 2023 18:20:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036353#M103991</guid>
      <dc:creator>CertainlyMe</dc:creator>
      <dc:date>2023-01-22T18:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: SamePeriodLastYear returns an empty colum but with a correct total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036363#M103992</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="502727" data-lia-user-login="CertainlyMe" class="lia-mention lia-mention-user"&gt;CertainlyMe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAMEPERIODLASTYEAR is a time intelligence function that requires a proper date table with unique and contiguous date values. Create a date table snd create a relationship between the date table snd your table then you can use 'Date'[Date] in SAMEPERIODLASTYEAR&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jan 2023 18:56:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036363#M103992</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-22T18:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: SamePeriodLastYear returns an empty colum but with a correct total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036401#M103995</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yess it worked !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jan 2023 20:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SamePeriodLastYear-returns-an-empty-colum-but-with-a-correct/m-p/3036401#M103995</guid>
      <dc:creator>CertainlyMe</dc:creator>
      <dc:date>2023-01-22T20:58:51Z</dc:date>
    </item>
  </channel>
</rss>

