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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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