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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
abeinke2018
Frequent Visitor

Lookup Max Value between date/time for each day

Hi, this has been extremely frustrating as I am simply trying to return the last value for each day 

 

I have a dynamic calendar which Im trying to return the value to

I can do a max lookup but only returns the first value for the NEXT day (Not the last value for the current day) if i could put 0.9 there instead of 1, then I could get this to work

 

A better formula would be apreciated though

Thankyou

 

Diesel Balance (L) = (LOOKUPVALUE(Balances[Diesel],Balances[TimeStamp],(MAX(Balances[TimeStamp]))+1))

 

 

I want to return the value in yellowI want to return the value in yellow

1 ACCEPTED SOLUTION

hi,@abeinke2018

     That formula is to create a column and if you want to create a measure, you can try to use this formula:

Measure = LOOKUPVALUE(Balances[Diesel],Balances[TimeStamp],CALCULATE(MAX(Balances[TimeStamp]),ALLEXCEPT(Balances,Balances[Date])))

Result:

13.PNG

 

 

Best Regards,

Lin

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

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi,@abeinke2018

     After my research, you can use this formula:

Diesel Balance (L) = (LOOKUPVALUE(Balances[Diesel],Balances[TimeStamp],CALCULATE(MAX(Balances[TimeStamp]),FILTER(Balances,Balances[Date]=EARLIER(Balances[Date])))))

Result:

1.PNG

Best Regards,

Lin

 

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

Hi Lin, this looks great, the only problem is the last part of the formula ... EARLIER(Balances[Date] returns an error as per below

 

1324.jpg

hi,@abeinke2018

     That formula is to create a column and if you want to create a measure, you can try to use this formula:

Measure = LOOKUPVALUE(Balances[Diesel],Balances[TimeStamp],CALCULATE(MAX(Balances[TimeStamp]),ALLEXCEPT(Balances,Balances[Date])))

Result:

13.PNG

 

 

Best Regards,

Lin

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

Thankyou for this, it worked well

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors