Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am looking for logic to determine how to pull the following data
I have a fact table that has transaction date and time and computer per transaction the second table is the device table showing who was logged into the device (there is no log out). My intended logic will be to link date, and device ID and then find the time that is the first time found less the log in time from the fact table . So the first entry I want to determine BOB was logged and second ROB
Date Time Device
Example : 1/1/17 08:10:53 RFGN3550
1/1/17 10:13:40 RFGN3560
I have a device Log table that says who was logged into that device
Log in Date Time Device Person
Example: 1/1/17 08:00:00 RFGN3550 BOB
1/1/17 09:00:00 RFGN3550 MARY
1/1/17 09:00:00 RFGN3560 SAM
1/1/17 10:00:00 RFGN3550 ROB
Solved! Go to Solution.
This seems to have been deemed an M question, but here is one of those "dime a dozen" DAX solutions:
Calculated column in Transactions:
Person = VAR TransactionDateTime = Transactions[DateTime] RETURN CALCULATE ( //Arbitrary tie-breaker FIRSTNONBLANK ( Logins[Person], 0 ), CALCULATETABLE ( LASTNONBLANK ( Logins[DateTime], 0 ), Logins[DateTime] <= TransactionDateTime ) )
Owen 🙂
I suspect you've modified @OwenAuger's formula to only look at your Time columns!
Note that he checks a Date/Time column.
So to address this create a Date-Time Column in both tables like this
Date-Time = [Date]&" "&[Time]
Both of these columns will default to Text - so you need to convert them to Data Type - Date/Time - again in both tables.
This should resolve it!
Good Luck!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |