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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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