<?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: Create YoY Measure without error A date column containing duplicate dates was specified in the call in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266316#M169098</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834134" data-lia-user-login="rks408" class="lia-mention lia-mention-user"&gt;rks408&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some dummy data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ItemCount LY = 
CALCULATE(
    COUNT('Count Table'[Title]),
    YEAR('Count Table'[Created On]) = YEAR(MAX('Count Table'[Created On])) - 1
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2024 02:35:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-01T02:35:01Z</dc:date>
    <item>
      <title>Create YoY Measure without error A date column containing duplicate dates was specified in the call</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266084#M169077</link>
      <description>&lt;P&gt;I am a novice at PowerBI and I'm very confused with measures and dates at the moment so any guidance would help. I'm trying to create a few year over year charts/tables that are counting the number of items created by the date created. This is what I have right now:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A date field Created On&lt;/LI&gt;&lt;LI&gt;A title field Title&lt;/LI&gt;&lt;LI&gt;A measure ItemCount = COUNT(table[Title])&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;A measure ItemCount LY = CALCULATE(COUNT(table[Title]), DATEADD(table[Created On], -1, YEAR))&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I then tried to check if my measures worked by creating a table. I put the Created On field with only the year in the date hierarchy and the measure ItemCount. That came out fine. But when I tried to add ItemCount LY I received the error "A date column containing duplicate dates was specified in the call to function 'DATEADD'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I researched this error and I understand that measures need aggregated data to work and I guess the created on field that I was referencing has multiple items with the same date. But I don't understand how to proceed. How can I get unique dates? I've looked up functions that could retrieve only unique dates, or I've seen people suggest creating a date table, but this report is not using a directquery connection. So my ability to make new columns and tables is disabled which seems to be hindering me a lot. I can only create measures. Is there any way forward?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 20:33:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266084#M169077</guid>
      <dc:creator>rks408</dc:creator>
      <dc:date>2024-10-31T20:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create YoY Measure without error A date column containing duplicate dates was specified in the call</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266316#M169098</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834134" data-lia-user-login="rks408" class="lia-mention lia-mention-user"&gt;rks408&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some dummy data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ItemCount LY = 
CALCULATE(
    COUNT('Count Table'[Title]),
    YEAR('Count Table'[Created On]) = YEAR(MAX('Count Table'[Created On])) - 1
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 02:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266316#M169098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-01T02:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create YoY Measure without error A date column containing duplicate dates was specified in the call</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266973#M169152</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, thank you for your reply. This got rid of my error message but the data isn't populating in the table correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The year property of the date hierarchy for Created On is being used. The dummy data you provided reflects what my data looks like. When I had Created On as just the date and not the hierarchy, 208 did populate for 2018's ReportCountLY but when the data is aggregated it is not working. Thank you&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 13:31:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4266973#M169152</guid>
      <dc:creator>rks408</dc:creator>
      <dc:date>2024-11-01T13:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create YoY Measure without error A date column containing duplicate dates was specified in the call</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4268071#M169222</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834134" data-lia-user-login="rks408" class="lia-mention lia-mention-user"&gt;rks408&lt;/a&gt;, and thank you&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;for this excellent approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Building on the DAX by Nono Chen, can you please try this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ItemCount LY = 
CALCULATE(
    COUNT('Count Table'[Title]),
    FILTER(
        ALL('Count Table'[Created On]),
        YEAR('Count Table'[Created On]) = YEAR(MAX('Count Table'[Created On])) - 1
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2024 14:56:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4268071#M169222</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-11-03T14:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create YoY Measure without error A date column containing duplicate dates was specified in the call</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4269293#M169288</link>
      <description>&lt;P&gt;Hi Sahir,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still having issues with the aggregated data. As you can see when I use just the date for Created On, it is calculating 208 for all of 2018 at the row level and when I use the year from the Created On date hierarchy it is blank. Is there perhaps a different way I should be formatting Created On? Once again I am limited as I cannot create a new table or columns.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 14:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4269293#M169288</guid>
      <dc:creator>rks408</dc:creator>
      <dc:date>2024-11-04T14:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create YoY Measure without error A date column containing duplicate dates was specified in the call</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4270385#M169340</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834134" data-lia-user-login="rks408" class="lia-mention lia-mention-user"&gt;rks408&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&amp;nbsp;Sahir_Maharaj&amp;nbsp;for your prompt reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the screenshot information you provided, I made some adjustments to this solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create measures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ItemCount = COUNT('Count Table'[Title])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ItemCount LY = 
CALCULATE(
    COUNT('Count Table'[Title]),
    FILTER(
        'Count Table',
        YEAR('Count Table'[Created On]) &amp;lt;= YEAR(TODAY()) - 1
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 09:13:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-YoY-Measure-without-error-A-date-column-containing/m-p/4270385#M169340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-05T09:13:33Z</dc:date>
    </item>
  </channel>
</rss>

