cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abarnett Regular Visitor
Regular Visitor

Count of Houses Between Dates

Hello! I am hoping this is simpler than it sounds, but I am looking to find a way to get the count of houses we have in WIP with a certain time period as in. I have a table with a house number, release date, and a close date. I want to know within a given month how many are in WIP. So as in example: November of 2018, I would want to know the count of houses with a close date after November of 2018 (or none at all) but a release date of November of 2018 or before. 

 

I want the criteria to change for whatever month I choose. 

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
abarnett Regular Visitor
Regular Visitor

Re: Count of Houses Between Dates

# of Houses in WIP = CALCULATE(
COUNTROWS(HOUSEMASTER),
FILTER(
HOUSEMASTER,(AND(HOUSEMASTER[RELEASE_DATE] <= LASTDATE('Date Table'[Date]),HOUSEMASTER[RELEASE_DATE]) && OR(HOUSEMASTER[SETTLEMENT_DATE]>= FIRSTDATE('Date Table'[Date]),HOUSEMASTER[SETTLEMENT_DATE]=0)
)
)
)

This is the code I ended up using and does show what I am looking for. Thank you for your help though! 

3 REPLIES 3
abarnett Regular Visitor
Regular Visitor

Re: Count of Houses Between Dates

Here is some code I have so far:

# of Houses in WIP = CALCULATE(COUNTROWS(HOUSEMASTER),FILTER(HOUSEMASTER,(HOUSEMASTER[RELEASE_DATE] <= LASTDATE('Date Table'[Date]) && HOUSEMASTER[SETTLEMENT_DATE]>= FIRSTDATE('Date Table'[Date]))))

The results miss some houses and doesn't take into account if there is a blank settlement date which is fairly important. Not sure how to add that. 

Highlighted
Community Support Team
Community Support Team

Re: Count of Houses Between Dates

HI @abarnett ,

Please try to use below measure formula if it works:

# of Houses in WIP =
CALCULATE (
    COUNTROWS ( HOUSEMASTER ),
    FILTER (
        ALLSELECTED ( HOUSEMASTER ),
        (
            HOUSEMASTER[RELEASE_DATE] <= MIN ( 'Date Table'[Date] )
                && HOUSEMASTER[SETTLEMENT_DATE] >= MAX ( 'Date Table'[Date] )
        )
    )
)

If above not help, please share some sample data for test.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
abarnett Regular Visitor
Regular Visitor

Re: Count of Houses Between Dates

# of Houses in WIP = CALCULATE(
COUNTROWS(HOUSEMASTER),
FILTER(
HOUSEMASTER,(AND(HOUSEMASTER[RELEASE_DATE] <= LASTDATE('Date Table'[Date]),HOUSEMASTER[RELEASE_DATE]) && OR(HOUSEMASTER[SETTLEMENT_DATE]>= FIRSTDATE('Date Table'[Date]),HOUSEMASTER[SETTLEMENT_DATE]=0)
)
)
)

This is the code I ended up using and does show what I am looking for. Thank you for your help though! 

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 334 members 4,225 guests
Please welcome our newest community members: