Forum Discussion
Current day employee location
- Anonymous4 years ago
Hi Syndicate_Admin ,
Please refer this formula.
Column = var last_day = CALCULATE(MAX('Table'[DAY]),FILTER('Table','Table'[USER]=EARLIER('Table'[USER])&&'Table'[TYPE]=EARLIER('Table'[TYPE]))) return CALCULATE(MAX('Table'[LOCATION]),FILTER(ALLEXCEPT('Table','Table'[USER],'Table'[TYPE]),'Table'[DAY]=last_day))Best Regards,
Jay
Syndicate_Admin , You need to have timestamp for that or add index column in power query
Last Location = var _max = maxx(filter(ALLSELECTED(Data), Data[USER] = Max(Data[USER]) && Data[Date] = Max(Data[Date])), Data[Time])
return
CALCULATE(max(Data[Location]), filter((Data) , Data[Time] =_max))
Refer
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
- Syndicate_Admin4 years ago
Administrator
Thank you very much, but it does not work, I have put the formula that you have told me in the column and in ALL users I get that they work from the office when it is not so. For example, this user last signed yesterday from CASA:
I have used the formula that you have passed me, but adapted to my data:
Last Status = where _max = maxx(filter(ALLSELECTED('Presence control'), 'Presence control'[User] = Max('Presence control'[User])), 'Presence control'[EntryDate])returnCALCULATE(Max([Location]), filter(('Presence control') , 'Presence control'[EntryDate] =_max))I think there's something I haven't done right.
Thanks a lot!