<?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: Cumulative Distinct Count by Day Behaving Incorrectly with Filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973787#M43410</link>
    <description>&lt;P&gt;Calculated tables are &lt;STRONG&gt;STATIC&lt;/STRONG&gt;. Once calculated, they never change. You need a measure, not a table.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jul 2021 16:09:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-22T16:09:23Z</dc:date>
    <item>
      <title>Cumulative Distinct Count by Day Behaving Incorrectly with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973778#M43407</link>
      <description>&lt;P&gt;Hi there, I am trying to plot a cumulative distinct count graph of IDs from this table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I used the following DAX code to generate a cumulative distinct count table by date:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;CumTable = SELECTCOLUMNS(&lt;BR /&gt; DISTINCT('Learner Info Daily'[Created Date]),&lt;BR /&gt; "Date", 'Learner Info Daily'[Created Date],&lt;BR /&gt; "CumUsers", CALCULATE(DISTINCTCOUNT('Learner Info Daily'[ID]), FILTER(ALLSELECTED('Learner Info Daily'), 'Learner Info Daily'[Created Date] &amp;lt;= EARLIER('Learner Info Daily'[created date]))&lt;BR /&gt; )&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Which looks like:&lt;/SPAN&gt;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, plotting this with slicers on "Location" does not behave as expected - the cumulative distinct count is the same for each location, the only difference being the x axis (since the dates at which certain locations started getting IDs was different for each):&lt;/P&gt;&lt;img /&gt;&lt;img /&gt;&lt;P&gt;The only relationship between the two tables is on the date column. I am confused as to where it is going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any help on this - thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Jul 2021 18:16:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973778#M43407</guid>
      <dc:creator>oliverblane72</dc:creator>
      <dc:date>2021-07-22T18:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Distinct Count by Day Behaving Incorrectly with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973787#M43410</link>
      <description>&lt;P&gt;Calculated tables are &lt;STRONG&gt;STATIC&lt;/STRONG&gt;. Once calculated, they never change. You need a measure, not a table.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 16:09:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973787#M43410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-22T16:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Distinct Count by Day Behaving Incorrectly with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973793#M43411</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Please create a proper calendar in your
// model following the guidelines outlined here:
// https://dax.guide/dateadd
// and connect it to your fact table and remember
// that fact tables should always be hidden and
// slicing should only happen via dimensions. If
// you want to get into trouble, ignore the rule.
//
// Then you can write:

[# Distinct ID to Date] =
var CurrentDate = MAX( Dates[Date] )
return
	CALCULATE(
		DISTINCTCOUNT( 'Learner Info Daily'[LRN] ),
		KEEPFILTERS( Dates[Date] &amp;lt;= CurrentDate ),
		ALLSELECTED( Dates )
	)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 16:15:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973793#M43411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-22T16:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Distinct Count by Day Behaving Incorrectly with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973964#M43422</link>
      <description>&lt;P&gt;Hi there, I cannot thank you enough - your solution works perfectly!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing I am confused about is why we need ALLSELECTED( Dates ). Apologies if this is a silly question, I am quite new to DAX and Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 18:21:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973964#M43422</guid>
      <dc:creator>oliverblane72</dc:creator>
      <dc:date>2021-07-22T18:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Distinct Count by Day Behaving Incorrectly with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973965#M43423</link>
      <description>&lt;P&gt;Right, I see! Thank you, Daxer.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 18:22:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Distinct-Count-by-Day-Behaving-Incorrectly-with/m-p/1973965#M43423</guid>
      <dc:creator>oliverblane72</dc:creator>
      <dc:date>2021-07-22T18:22:17Z</dc:date>
    </item>
  </channel>
</rss>

