<?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: Creating Measures for distinct count between 2 custom dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1798309#M37895</link>
    <description>&lt;P&gt;Thank you this was helpful, especially the date table set up.&amp;nbsp; However I am still running into an issue because I am not using the SUM function on numbers, I am actually counting records on the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CONTACT_ID&lt;/TD&gt;&lt;TD&gt;Lead Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abcd&lt;/TD&gt;&lt;TD&gt;08/15/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;efgh&lt;/TD&gt;&lt;TD&gt;06/28/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ijkl&lt;/TD&gt;&lt;TD&gt;08/15/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;mnop&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;04/01/2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case I am trying to count distinct IDs on current year (8/1/2020 - 7/31/2021),previous year, and previous year to date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My expected outcome would be -&lt;/P&gt;&lt;P&gt;Current Year - 2&lt;/P&gt;&lt;P&gt;Previous Year - 2&lt;/P&gt;&lt;P&gt;Previous YTD - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 17:55:46 GMT</pubDate>
    <dc:creator>ncondon22</dc:creator>
    <dc:date>2021-04-21T17:55:46Z</dc:date>
    <item>
      <title>Creating Measures for distinct count between 2 custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1797919#M37875</link>
      <description>&lt;P&gt;I have a dataset of leads with unique IDs and lead dates for the past 2 years.&amp;nbsp; However, the years are not based on the calendar year, but a custom time frame 8/1 - 7/31.&amp;nbsp; I also created a date table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create measures that do the following -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prior Year leads - distinct count of IDs for lead date between 8/1/19 - 7/31/2020&lt;/P&gt;&lt;P&gt;Current Year leads - distinct count of IDs for lead date between 8/1/20 - 7/31/2021&lt;/P&gt;&lt;P&gt;Prior Year Leads to date - count of prior year leads up to current date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to do this with the data separated into 2 queries using DAX below, but was unsure how to accomplish it with mixed data set.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total CY Leads = COUNTA(CY_Leads[CONTACTID])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total PY Leads = COUNTA(PY_Leads[CONTACTID])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Apr 2021 14:05:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1797919#M37875</guid>
      <dc:creator>ncondon22</dc:creator>
      <dc:date>2021-04-21T14:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Measures for distinct count between 2 custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1797935#M37876</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="297312" data-lia-user-login="ncondon22" class="lia-mention lia-mention-user"&gt;ncondon22&lt;/a&gt; , YTD allows your the end date of your choice &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"7/31"))&lt;BR /&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"7/31"))&lt;BR /&gt;This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"7/31"))&lt;BR /&gt;Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"7/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to get calendar of your choice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating Financial Calendar - From Any Month &lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Year on Year with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=km41KfM_0uA" target="_blank"&gt;https://www.youtube.com/watch?v=km41KfM_0uA&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 14:13:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1797935#M37876</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-04-21T14:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Measures for distinct count between 2 custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1798309#M37895</link>
      <description>&lt;P&gt;Thank you this was helpful, especially the date table set up.&amp;nbsp; However I am still running into an issue because I am not using the SUM function on numbers, I am actually counting records on the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CONTACT_ID&lt;/TD&gt;&lt;TD&gt;Lead Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abcd&lt;/TD&gt;&lt;TD&gt;08/15/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;efgh&lt;/TD&gt;&lt;TD&gt;06/28/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ijkl&lt;/TD&gt;&lt;TD&gt;08/15/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;mnop&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;04/01/2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case I am trying to count distinct IDs on current year (8/1/2020 - 7/31/2021),previous year, and previous year to date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My expected outcome would be -&lt;/P&gt;&lt;P&gt;Current Year - 2&lt;/P&gt;&lt;P&gt;Previous Year - 2&lt;/P&gt;&lt;P&gt;Previous YTD - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 17:55:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measures-for-distinct-count-between-2-custom-dates/m-p/1798309#M37895</guid>
      <dc:creator>ncondon22</dc:creator>
      <dc:date>2021-04-21T17:55:46Z</dc:date>
    </item>
  </channel>
</rss>

