First of all, for a question like this, it is always a good idea to post the CREATE TABLE statement for your table(s) and INSERT statements with sample data together with the desired result given the sample. This makes it easy to copy and paste into a query window to develop a tested query.
What you have below is an entirely untested query.
SELECT U.UserID, U.UserName, P.Edatetime, P.DeviceName, P.InOutType
FROM Users U
CROSS APPLY (SELECT TOP (1) P.Edatetime, P.DeviceName, P.InOutType
FROM PowerBI_data P
WHERE P.UserID = U.UserID
ORDER BY P.Edatetime DESC) AS P
If you don't have a Users table, you can replace FROM Users
with
FROM (SELECT DISTINCT UserID, UserName FROM PowerBI_data) AS U