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! Learn more

Reply
maserr
Helper IV
Helper IV

Filter column by another column

Hi there,

 

I have a table with several fields. One of them is the date and another one is the time. I need to filter the table to retrieve the last date and the last time of this date. I am using FILTER function and LASTDATE to filter the table and using LASTNOTBLANK to get the last time, but this last function has to be applied on the field already filtered.

 

How can I achieve this?

 

Thanks,

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @maserr

 

Try the measure as below:

LastHourLastDay = 
CALCULATE(MAX('Table'[Value2]),FILTER(ALL('Table'),'Table'[Value1]=MAXX(ALL('Table'),'Table'[Value1])))

And you will see:

Annotation 2020-07-30 171252.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

7 REPLIES 7
v-kelly-msft
Community Support
Community Support

Hi @maserr

 

Try the measure as below:

LastHourLastDay = 
CALCULATE(MAX('Table'[Value2]),FILTER(ALL('Table'),'Table'[Value1]=MAXX(ALL('Table'),'Table'[Value1])))

And you will see:

Annotation 2020-07-30 171252.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
simrantuli
Continued Contributor
Continued Contributor

Hi @maserr,

The requirement is not very clear to me. Please share sample dataset.

 

Regards

Hi,

 

here is attached my example:

 

https://drive.google.com/file/d/1dDM6v5_PIbk0J8pSqGO0uumN_aXRe5FS/view?usp=sharing

 

with the solution purposed I am getting the last time but not 09:30:30 which would be the one correct.

 

Thanks

Hi @maserr

 

The link you shared is not a public one,pls share us a public one.

 

 

Best Regard,

Kelly

amitchandak
Super User
Super User

@maserr ,

Try lik

lastnonblankvalue(Table[date],max(Table[column]))

 

refer : https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Mariusz
Community Champion
Community Champion

Hi @maserr 

 

Can you create a data sample?

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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