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
setis
Post Partisan
Post Partisan

Get the earlier matching result

Dear all,

 

I have one table with rates:

DateRate
01-01-20200,5
02-01-20200,4
04-01-20200,6
05-01-20200,3

 

I need a calculate column in another table bringing these rates. If there is no matching date, I need the earlier date to the missing one. 

 

This is the expected results when the 03-01-2020 is missing in the above table:

DateExchange
01-01-20200,5
02-01-20200,4
03-01-20200,4
04-01-20200,6

 

It doesn't find any match for the 03-01-2020 and finds the first available before that, the rate for the 02-01-2020 that is 0,4.

I'm not sure how to approach this. 

I tried this but the results are not correct:

 

earlier_.PNG

 

Thank you in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@setis , Instead of first nonblank try .

 

lastnonblankvalue([Date],[Rate])

 

rest of the Column formula will be the same.

 

The assumption, You have the missing date in the table and creating a new column.

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@setis , Instead of first nonblank try .

 

lastnonblankvalue([Date],[Rate])

 

rest of the Column formula will be the same.

 

The assumption, You have the missing date in the table and creating a new column.

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.