<?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: Chart with TotalCount Members per Years. Need to filter by max create month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1067991#M14949</link>
    <description>&lt;P&gt;I didn't look at the pbix but this may be overly complicated.&amp;nbsp; To create a drillable measure that give the count of active members over any given time period, you can do a measure like this (assuming you have a Date table that has no relationship to your members table (or you inactivate the relationship for this one measure with CROSSFILTER()).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MemberCount = var mindate = Min(Date[Date])&lt;BR /&gt;var maxdate = Max(Date[Date])&lt;/P&gt;&lt;P&gt;return calculate(countrows(MemberTable), MemberTable[StartDate] &amp;lt;= maxdate, MemberTable[EndDate] &amp;gt;= mindate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can them use Time Intelligence measures to calculate this measure over different time periods for comparison, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are also appreciated.&amp;nbsp; Please let me know if not.&lt;BR /&gt;Regards,&lt;BR /&gt;Pat&lt;/P&gt;</description>
    <pubDate>Mon, 04 May 2020 22:51:37 GMT</pubDate>
    <dc:creator>mahoneypat</dc:creator>
    <dc:date>2020-05-04T22:51:37Z</dc:date>
    <item>
      <title>Chart with TotalCount Members per Years. Need to filter by max create month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1066875#M14923</link>
      <description>&lt;P&gt;Hi all, hope someone can help with my membership count issue&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the end I included a link to sample .pbix file&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;First some high level explanation: &amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;One year has members with different membership durations who have purchased their membership at one point in time.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;To count all the members in 2020 I need to count members with the following membership dates:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;StartDate membership 2019- EndDate membership 2020&lt;/LI&gt;&lt;LI&gt;StartDate membership 2020- EndDate membership 2020&lt;/LI&gt;&lt;LI&gt;StartDate membership 2020- EndDate membership 2021&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Those 2020 members could have purchased their membership before their membership period started or during their membership period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Membership sample table:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ContactId&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;StartDate membership&lt;/P&gt;&lt;P&gt;(Date type)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;EndDate membership&lt;/P&gt;&lt;P&gt;(Date type)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Membership created&lt;/P&gt;&lt;P&gt;(Date type)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Other columns with membership info&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. Type&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Other columns with contact info&lt;/P&gt;&lt;P&gt;E.g. country&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;45689&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 January 2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 December 2017&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Trainee&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Germany&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;47546&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15 February 2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15 February 2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Active&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;France&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;41598&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;23 March 2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;16 December 2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Trainee&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Belgium&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;58964&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15 June 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2 February 2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Retired&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Hungary&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;68465&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15 June 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;13 March 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Retired&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Bulgaria&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;65465&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 January 2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;14 November 2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Active&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Brazil&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;65465&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 January 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 January 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Active&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Congo&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;65469&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 January 2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31 December 2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1 January 2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Active&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Netherlands&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;&lt;STRONG&gt;Request User: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The user sees a chart with the total count of members by year. He wants to filter this total amount of members by date.&lt;/P&gt;&lt;P&gt;Example: Today is April 24th. He wants to compare the total amount of members the company had end of March for this year and past years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means I need to add a month filter for the user so they can filter the TotalMemberCount from all the memberyears until the month they desire. However I don’t know how to add this in my measures… &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To create the chart I have done the following:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chart :&lt;/P&gt;&lt;P&gt;Clustered column chart showing the total number of members by membership year.&lt;/P&gt;&lt;P&gt;The x-Axis of the chart are the years (from step 4) and the Value of the chart is a measure using switch (step 5). This switch measure has as values the different years (2017 until 2020) and as result a measure that calculates the total count of members for that year (step 3).&lt;/P&gt;&lt;P&gt;See detailed steps below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 : Create a Table ‘Years’. This table contains one column [Years] with years from 2017 until 2021 and has no relationship with other tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2:&amp;nbsp; Create a measure ‘CountTotalMembers Y’ that counts the total members in one year. This measure is also created for year -1 and year -2. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 3: Create a Year To Date Measure for every of the previous measures, using the create date of the membership.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 4: Create a table 'Switch Support Year" which has no relationship with other tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 5: Create a measure 'Switch years'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Help:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What should I add or change in order to enable filtering by month? Please let me know if I am not clear enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to sample&amp;nbsp;&lt;A href="https://hqesa-my.sharepoint.com/:u:/g/personal/julie_buyens_esahq_org/EYbIj3LFcOBKlXMf2bCWknkBNr4afKiahjK6r-H9MEQMvw?e=bW40XH" target="_blank" rel="noopener"&gt;.pbix file&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 13:54:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1066875#M14923</guid>
      <dc:creator>Temminck</dc:creator>
      <dc:date>2020-05-04T13:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chart with TotalCount Members per Years. Need to filter by max create month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1067991#M14949</link>
      <description>&lt;P&gt;I didn't look at the pbix but this may be overly complicated.&amp;nbsp; To create a drillable measure that give the count of active members over any given time period, you can do a measure like this (assuming you have a Date table that has no relationship to your members table (or you inactivate the relationship for this one measure with CROSSFILTER()).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MemberCount = var mindate = Min(Date[Date])&lt;BR /&gt;var maxdate = Max(Date[Date])&lt;/P&gt;&lt;P&gt;return calculate(countrows(MemberTable), MemberTable[StartDate] &amp;lt;= maxdate, MemberTable[EndDate] &amp;gt;= mindate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can them use Time Intelligence measures to calculate this measure over different time periods for comparison, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are also appreciated.&amp;nbsp; Please let me know if not.&lt;BR /&gt;Regards,&lt;BR /&gt;Pat&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 22:51:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1067991#M14949</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-05-04T22:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Chart with TotalCount Members per Years. Need to filter by max create month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1072843#M14999</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226208" data-lia-user-login="mahoneypat" class="lia-mention lia-mention-user"&gt;mahoneypat&lt;/a&gt;, thanks a lot !&amp;nbsp;I applied your measure and ideas with some changes and it works &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;Could you also explain the difference in adding .[date] or not to a date column in a measure?&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;table[date column].[date]&amp;nbsp; &amp;nbsp;OR&lt;/LI&gt;&lt;LI&gt;table[date column]&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I had to play a bit with this and don't understand the difference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 12:58:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-with-TotalCount-Members-per-Years-Need-to-filter-by-max/m-p/1072843#M14999</guid>
      <dc:creator>Temminck</dc:creator>
      <dc:date>2020-05-05T12:58:58Z</dc:date>
    </item>
  </channel>
</rss>

