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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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