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
sharpedogs
Advocate II
Advocate II

Time Functions when the date periods are not even

Hi, 

I am getting 1 to 2 files a week. They don't come on the exact days each week. The date I'm using is coming from the name of the file as that the date of the data extract. I want to create some trending views but i can't use the regular functions like last week ect.. because of the gaps in the dates between files. 

 

Essentially each file is it's own download and date and they are all appended together. I want to be able to show in a table the latest file and then the one before that. I'm not sure how to reference create time calculation to say the closest date before this one? 

3 REPLIES 3
lbendlin
Super User
Super User

That's what I was describing.  You can apply additional filters to LASTDATE().  Say you calculate the LASTDATE() but with a filter to say that it needs to be before the last observed date. That will give you the second to last date etc.

 

Or you go all crazy with something like MIN(TOPN,2,,desc) 🙂

lbendlin
Super User
Super User

- use MAX() or LASTDATE() with a filter to exclude the current (or max) date to identify the "second last" date

- think about interpolating between reports to compute the value as it would have likely been at weekly intervals etc.

MAX () is interesting.. I've played alot around with lastdate(). The issue I have is that the LastDate works for the last file, but then the one before that might be 3 days or 4 days or 7 days. Because the times vary i can't use a specific -7 days. I need it reference the last date without saying go back X days.

Something like a lastdate, excluding the current lastdate. i'm just not sure of the context.

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.

Top Solution Authors