<?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 DAX measure to calculate users who are active at the selected timeframe in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3727250#M145196</link>
    <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the % of users who had an event and had an active membership during the selected timeframe. For example, I have below two tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Membership Info - Table about when a member joined the membership&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Event Info - Table when a member had an event&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calulate the % of member who had an event and were active at the selected timeframe using the below slicer. Say, If my user selects April and May in the slicer, the output should be 100% because at the end of May, 3 users had event and their membership start date was before May. Similarly, If my user select July, the output should be 25% as only 1 user had en event in July and by the end of July we had 4 users whose membership start date was &amp;lt;= 31st of July&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;I am able to get the distinct user who had an event (i,e I am able to get the right number for numerator) however, facing error with denominator. I did write the below code but with incorrect result&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
var selected_date = SELECTEDVALUE(Sheet2[Event Date])
var memberswithmemship =
    CALCULATETABLE(
        VALUES(Sheet1[User ID]),
        Sheet1[Membership Date] &amp;lt;= selected_date
    )
return COUNTROWS(memberswithmemship)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone had similar usecase or anyone know a possible solution/approach I would be really grateful if you share the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Praj&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2024 10:54:28 GMT</pubDate>
    <dc:creator>Praj</dc:creator>
    <dc:date>2024-02-27T10:54:28Z</dc:date>
    <item>
      <title>DAX measure to calculate users who are active at the selected timeframe</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3727250#M145196</link>
      <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the % of users who had an event and had an active membership during the selected timeframe. For example, I have below two tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Membership Info - Table about when a member joined the membership&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Event Info - Table when a member had an event&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calulate the % of member who had an event and were active at the selected timeframe using the below slicer. Say, If my user selects April and May in the slicer, the output should be 100% because at the end of May, 3 users had event and their membership start date was before May. Similarly, If my user select July, the output should be 25% as only 1 user had en event in July and by the end of July we had 4 users whose membership start date was &amp;lt;= 31st of July&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;I am able to get the distinct user who had an event (i,e I am able to get the right number for numerator) however, facing error with denominator. I did write the below code but with incorrect result&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
var selected_date = SELECTEDVALUE(Sheet2[Event Date])
var memberswithmemship =
    CALCULATETABLE(
        VALUES(Sheet1[User ID]),
        Sheet1[Membership Date] &amp;lt;= selected_date
    )
return COUNTROWS(memberswithmemship)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone had similar usecase or anyone know a possible solution/approach I would be really grateful if you share the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Praj&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 10:54:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3727250#M145196</guid>
      <dc:creator>Praj</dc:creator>
      <dc:date>2024-02-27T10:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to calculate users who are active at the selected timeframe</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3728696#M145279</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 21:11:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3728696#M145279</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-27T21:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to calculate users who are active at the selected timeframe</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3730347#M145371</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. Below is the sample data as provided in the screenshot.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;I am trying to calulate the % of members who had an event and were part of membership at the selected timeframe.Say, If my user selects April and May in the slicer, the output should be 100% because at the end of May, 3 users had event and their membership start date was before May. Similarly, If my user select July, the output should be 25% as only 1 user had en event in July and by the end of July we had 4 users whose membership start date was &amp;lt;= 31st of July&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Membership Info Table&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&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TD&gt;2&lt;/TD&gt;&lt;TD&gt;01-Apr-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;05-Apr-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01-May-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;01-Jul-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;01-Oct-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;05-Oct-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;05-Oct-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;09-Dec-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;09-Dec-22&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 28 Feb 2024 10:48:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3730347#M145371</guid>
      <dc:creator>Praj</dc:creator>
      <dc:date>2024-02-28T10:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to calculate users who are active at the selected timeframe</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3731868#M145432</link>
      <description>&lt;P&gt;your sample data is not covering your scenarios well.&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;</description>
      <pubDate>Wed, 28 Feb 2024 23:48:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-users-who-are-active-at-the-selected/m-p/3731868#M145432</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-28T23:48:46Z</dc:date>
    </item>
  </channel>
</rss>

