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
Anonymous
Not applicable

Why Datesinperiod returns future date

Hello everyone,

I have a question. When I use the Datesinperiod function, it always returns the future dates, is there any way to eliminate them? 

Here is my code 

CAPAs Opened MTD Measure = CALCULATE(COUNT('CAPAs Opened MTD'[CAPA PR ID]),
    DATESINPERIOD('Date Table'[Date],LASTDATE('Date Table'[Date]), -1, MONTH))
 
Thanks for helping me
1 ACCEPTED SOLUTION

You could try DATESBETWEEN('Date'[Date], MAX('Fact  table'[Date]), TODAY())

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

A properly formed date table will have dates until 31 December in the final year, which could be why you're getting dates in the future. If you want to restrict it to 1 month from today you could use DATESINPERIOD('Date'[Date], TODAY(), -1, MONTH)

Anonymous
Not applicable

Hi @johnt75

I can not use Today(), because I need to include all the previous dates. My ideal result is from last date of my data to today.  Is that possible?

 

You could try DATESBETWEEN('Date'[Date], MAX('Fact  table'[Date]), TODAY())

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.