<?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: Active connections in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2942626#M97243</link>
    <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Correct the calculation of expiration date&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 17:56:56 GMT</pubDate>
    <dc:creator>keivan</dc:creator>
    <dc:date>2022-12-01T17:56:56Z</dc:date>
    <item>
      <title>Active connections</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2933533#M96572</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I would like to calculate the number of active connections.&lt;BR /&gt;My dataset is compose in this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Calendar Table (Date, Year, Month, etc.)&lt;BR /&gt;Connections Table (connection_id, etc.)&lt;BR /&gt;Consents Table (consent_id, connection_id, valid_until, etc.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When a client create a connection (connection_id 1111) he provide a consent (consent_id 2222) this consent has an expiration date (for example 25/08/2022). When this consent expire the client can renew the consent for its connection.&amp;nbsp;&lt;BR /&gt;If the client renew the consent, a new consent_id will be generate (consent_id 3333) but the connection_id would NOT change&amp;nbsp;(connection_id 1111).&lt;BR /&gt;&lt;BR /&gt;In order to calculate if an active connection is active, I have to check if the valid_until of its newest consent is &amp;lt; TODAY or not.&lt;BR /&gt;Consent_id are integer and are progressive numbers.&lt;BR /&gt;&lt;BR /&gt;Sorry to bother you, but I don't know how to make BI perform this calculation.&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 16:31:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2933533#M96572</guid>
      <dc:creator>keivan</dc:creator>
      <dc:date>2022-11-28T16:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Active connections</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2935311#M96687</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="452039" data-lia-user-login="keivan" class="lia-mention lia-mention-user"&gt;keivan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get active connection id, you can create a measure to filter your id list.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _LASTDATE =
    CALCULATE (
        MAX ( Consents[valid_until] ),
        FILTER (
            Consents,
            Consents[connection_id] = MAX ( Connections[connection_id] )
        )
    )
RETURN
    IF ( _LASTDATE &amp;gt;= TODAY (), 1, 0 )&lt;/LI-CODE&gt;
&lt;P&gt;Add this measure into visual level filter and set it to show items when value =1.&lt;/P&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;According to your statement, I think your requirement is based on your data model. Please share a sample file with me and show me a screenshot with the result you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 09:57:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2935311#M96687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-29T09:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Active connections</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2942621#M97242</link>
      <description>&lt;P&gt;Thanks Rico,&lt;BR /&gt;&lt;BR /&gt;It almost works.&amp;nbsp;&lt;BR /&gt;I paste below the formula. If I remove the Return to the formula calculates correctly among the various consent the last one and report the expiration date. ( I share the screenshot).&lt;BR /&gt;&lt;BR /&gt;However keeping&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;_LASTDATE&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt; (), &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; )&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It reurns always 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Active Connections =&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_LASTDATE&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;consents[consent_valid_until]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Consents&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;consents[connection_business_id]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Connections[connection_business_id]&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;_LASTDATE&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt; (), &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 17:53:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2942621#M97242</guid>
      <dc:creator>keivan</dc:creator>
      <dc:date>2022-12-01T17:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Active connections</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2942626#M97243</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Correct the calculation of expiration date&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 17:56:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Active-connections/m-p/2942626#M97243</guid>
      <dc:creator>keivan</dc:creator>
      <dc:date>2022-12-01T17:56:56Z</dc:date>
    </item>
  </channel>
</rss>

