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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
hpayne93
Frequent Visitor

DAX measure to filter a date range

Hi,

 

I'm struggling to filter my measure within a time range.

 

I need to CALCULATE(COUNTROWS) of my 'Contact' whereby their 'contact[Diagnosis Date] is within the last year.

 

Any tips would be great!!

5 REPLIES 5
hpayne93
Frequent Visitor

Ah actually I need to update it slightly! I need to capture the 'contact'[diagnoses date] in relation to 'book application'[sentdate]

 

I need to be able to quantify where the 'book application'[sent date] is within a year of the diagnoses date. Is that at all possible?

You should just be able to change the last date in the measure to 'book application'[sent date] 

 

If I answered your question, please mark my post as solution

 

Appreciate your Kudos 👍

hpayne93
Frequent Visitor

Worked perfectly thankyou!

No problem, happy to help 🙂

DOLEARY85
Super User
Super User

Hi,
 
try something like this:
 
Last Year Days = CALCULATE (
        COUNTROWS( 'Table'),
        DATESINPERIOD ( 'Table'[update date], LASTDATE ( 'Table'[update date] ), -1, YEAR )
    )
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors