Forum Discussion
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,
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:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
7 Replies
- MariuszCommunity Champion
- amitchandakSuper 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
- simrantuliContinued Contributor
- maserrHelper IV
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
- v-kelly-msftCommunity Support
- v-kelly-msftCommunity 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:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!