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
lawsonbe
Helper I
Helper I

Finding the most recent date from another table

I have two tables that deal with dates. One is a Date Table that contains a basic_date calculated column. This other table is an Instructional Date Calendar that contains all the days my school system has held class on for the past 5 years. Each day has an instructional day number. This allows me to lign up my dates across years irregardless of weekends and holidays. In hindsight, I probably should have simply included all my calculated columns and measures in the date table but I am too far down the road now. I now need to find the most recent instructional day for each day in the Date Table. I am trying to work around the weekends and holidays during the school day. Some of my metrics need to calculate the number of days a student is enrolled and if I try to simply use Today() and am looknig at a table on a weekend, there will be an error. I have read several threads that used Earlier but could just not get it to quite work. The two fields I think that I need from the Date Table are Date Key and Basic Date. I am attaching screenshots of the tables if that helps at all.

 

Date Table.jpgInstructional Date Table.jpg

1 ACCEPTED SOLUTION

I finally gave up and created an additional column in the table and manually entered the data I needed. Ultimately the way I was thinking about the formula would only create data for a single year. I really wanted to have repeating values for each school year. Thanks for you the response.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@lawsonbe,

 

You may try using TOPN.

https://community.powerbi.com/t5/Desktop/Find-last-value-based-on-date/m-p/293150#M129228

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I finally gave up and created an additional column in the table and manually entered the data I needed. Ultimately the way I was thinking about the formula would only create data for a single year. I really wanted to have repeating values for each school year. Thanks for you the response.

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.