Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RichOB
Post Patron
Post Patron

Calculating active figures

Hi, in my scenario, I have some apartments where people have short and long term stays, I want to obtain the figures of active tenants per financial quarter (I already have a date table). Using the table below I need to show

 

Q1 = 4

Q2 = 5

Q3 = 6

Q4 = 6

 

Tenant_IDPropertyStart_DateEnd_DateStatus
11 ocean ave01/04/202401/05/2024Historic
21 ocean ave02/05/2024 Current
32 ocean ave10/04/202410/10/024Historic
42 ocean ave11/10/2024 Current
53 ocean ave01/04/2024 Current
61 park way01/07/2024 Current
72 park way01/07/202401/08/2024Historic
83 park way02/08/2024 Current
91 main road01/11/202410/11/2024Historic
101 main road11/11/2024 Current

 

Thanks

6 REPLIES 6
v-pagayam-msft
Community Support
Community Support

Hi @RichOB ,
Thank you for the helpful responses @MFelix , @Ashish_Mathur  and @Elena_Kalina !
Have you got an opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you for being part of the Microsoft Fabric Community.

Ashish_Mathur
Super User
Super User

Hi,

Based on the 10 row table that you have shared, show the expected result.  The numbers that you have shown in each quarter do not seem to tie up with the 10 row table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Elena_Kalina
Solution Specialist
Solution Specialist

Hi @RichOB 

Certainly! Let me clarify the quarterly calculation step by step using your table to understand why you're getting different results (Q1=4, Q2=5, Q3=6, Q4=6).

Key Rules for Active Leases per Quarter A lease is considered active in a quarter if: Start_Date ≤ Last day of the quarter AND (End_Date is empty or End_Date ≥ First day of the quarter).

Quarter Dates in 2024

Q1: Jan 1 – Mar 31

Q2: Apr 1 – Jun 30

Q3: Jul 1 – Sep 30

Q4: Oct 1 – Dec 31

My results: Q1= 0, Q2= 5, Q3= 3, Q4= 3

Hi @Elena_Kalina, apologies, the financial year in the UK starts in April and ends in March. I went over the numbers again, and I'm still getting the same as my original post.

 

I should have mentioned that if the end date is blank, then the tenancy is still active, and I would need the blank to show as today's date.

 

For example, in FY2024, Tenant number 2 should have been counted once in each quarter as they were active in each quarter.

 

I hope this helps to clarify my post. Thanks for your help!

Hi @RichOB ,

 

How do you consider a rent that finish before the end of the quarter is it active in the quarter or not?

MFelix_1-1750756629483.png

 

In this calculation I have made the consideration that if end during the quarter is active and the values I get are 4, 6,8,6.

If I do not consider them to be active at the end of the quarter then the numbers are different:

MFelix_2-1750756687925.png

The first one does not match your calculation

 

You need to have a calendar table has I refered with the fiscal quarter and year and then you can add one of two measures:

Leases in Period  with ended leases= 
COUNTROWS (
    FILTER (
        Rent,
        (
            Rent[Start_Date] <= MAX ( 'Calendar'[Date] )
                && Rent[End_Date] >= MIN ( 'Calendar'[Date] )
        )
            || (
                Rent[Start_Date] <= MAX ( 'Calendar'[Date] )
                    && Rent[End_Date] = BLANK ()
            )
    )
)

 

MFelix_3-1750756771864.png

 

Leases in Period  without ended leases = 
COUNTROWS (
    FILTER (
        Rent,
        (
            Rent[Start_Date] <= MAX ( 'Calendar'[Date] )
                && Rent[End_Date] >= MAX ( 'Calendar'[Date] )
        )
            || (
                Rent[Start_Date] <= MAX ( 'Calendar'[Date] )
                    && Rent[End_Date] = BLANK ()
            )
    )
) 

MFelix_4-1750756907500.png

 

Please see file attach.

Be aware that the calendar table is poorly build I just did some basic columns to make the example.

 



 




Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @RichOB ,

 

Add a calendar table to your model and then try the following measure:

Leases in Period = 
COUNTROWS (
    FILTER (
        Rent,
        (
            Rent[Start_Date] <= MAX ( 'Calendar'[Date] )
                && Rent[End_Date] >= MIN ( 'Calendar'[Date] )
        )
            || (
                Rent[Start_Date] <= MAX ( 'Calendar'[Date] )
                    && Rent[End_Date] = BLANK ()
            )
    )
)

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.