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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PowerPaddy
Frequent Visitor

Count of Rows that fall within a date range

Hello, I'm really strugging with a dax expression that seems like it should be fairly simple.

I have a table of Insurance Policies, 1 row for each policy. Each row has a POLICYSTARTDATE and POLICYENDDATE.
I want to show a daily/monthly count of Live policies, ie choose a date and display the number of rows for which that date falls within POLICYSTARTDATE and POLICYENDDATE.

Any help greatly appreciated.

2 REPLIES 2
MFelix
Super User
Super User

Hi @PowerPaddy,

 

Check this Post the answer should by preety similar to what I gave.

 

Regards,

MFelix


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



Zubair_Muhammad
Community Champion
Community Champion

@PowerPaddy

 

Try this measure

 

Adjust the mydate according to your needs. You can link it to a slicer as well

 

Measure =
VAR mydate =
    DATE ( 2017, 1, 22 )
RETURN
    COUNTROWS (
        FILTER (
            ADDCOLUMNS (
                TableName,
                "Live/Dead", IF (
                    mydate >= TableName[Policy Start Date]
                        && mydate <= TableName[Policy End Date],
                    "Live",
                    "Dead"
                )
            ),
            [Live/Dead] = "Live"
        )
    )

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors