<?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: How to calculate which period a customer was a tenant in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2813318#M89103</link>
    <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="437717" data-lia-user-login="v-yinliw-msft" class="lia-mention lia-mention-user"&gt;v-yinliw-msft&lt;/a&gt;. the calculation did not work for this particular question. The numbers are less than they need to be. Is there a way to send the dataset?&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 08:14:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-03T08:14:49Z</dc:date>
    <item>
      <title>How to calculate which period a customer was a tenant</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2803033#M88270</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hey everyone,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Could you help with a calculation to count the number of customers who were tenants within a specific year?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in 2010, how many people were tenants - meaning every customer who had an active tenancy before and up to 2010 and tenant end date after 2010 and still active (blank)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unable to attach the excel file which details the data. I have too many rows to PrintScreen it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Filter on Tenant Start Date to 2010&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Filter on Tenant End Date after 2010&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate this year on year to date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking the time&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 14:21:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2803033#M88270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-28T14:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate which period a customer was a tenant</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2804925#M88415</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand your requests correctly, you can try this method below:&lt;/P&gt;
&lt;P&gt;I create a sample table to do this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then, find the max year and the min year. Measure below:&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Min Year = MIN('Test Table'[Tenant Start Date].[Year])

Max Year = MAX('Test Table'[Tenant End Date].[Year] )&lt;/LI-CODE&gt;
&lt;P&gt;Then we can get a table between the min and the max year:&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year Table = CALENDAR(DATE([Min Year],1,1), DATE([Max Year],1,1))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And retain the years, create a new table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Years = ALL('Year Table'[Date].[Year])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the “Years” table, we need to find out the number of tenant :&lt;/P&gt;
&lt;P&gt;New a column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Number of Customers =
CALCULATE (
    COUNT ( 'Test Table'[Tenant ID] ),
    FILTER (
        'Test Table',
        'Test Table'[Tenant Start Date].[Year] &amp;lt;= [Year]
            &amp;amp;&amp;amp; 'Test Table'[Tenant End Date].[Year] &amp;gt;= [Year]
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Then we can get the table below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the report, set a slicer with Year and set a card with Number of Customers:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can this solve your questions?&lt;/P&gt;
&lt;P&gt;Hope this helps you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Yinliw&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 05:39:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2804925#M88415</guid>
      <dc:creator>v-yinliw-msft</dc:creator>
      <dc:date>2022-09-29T05:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate which period a customer was a tenant</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2813318#M89103</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="437717" data-lia-user-login="v-yinliw-msft" class="lia-mention lia-mention-user"&gt;v-yinliw-msft&lt;/a&gt;. the calculation did not work for this particular question. The numbers are less than they need to be. Is there a way to send the dataset?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 08:14:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-which-period-a-customer-was-a-tenant/m-p/2813318#M89103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-03T08:14:49Z</dc:date>
    </item>
  </channel>
</rss>

