Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Bit of a complex one...
I have a time/date column called [Date Created] and a [Username] column, I want to calculate the duration between the first and next times - when the [Username] is the same, and the date of the [Date Created] field is the same. So my new column called [New Start Time] should populate the next [Date Created] against each row when the user is the same, and the date is the same, else it is left blank.
Before I created my calculated column, I sorted the [Date Created] ascending and added an [Index] column. Because I want it to check the username AND the date are the same, I also added a [Weekday] column.
My calculated column is below, and it works inconsistently which means sometimes it's populating the next [Date Created] when it's a different day, thus the duration between is 3,000 minutes instead of about 20 minutes. And sometimes it ignores the rule and leaves a blank [New Start Time] when the username and day is the same. So, I think my measure is wrong, and i'm hoping someone can help me!!
New Start Time = IF(AND([Username] = LOOKUPVALUE([Username],[Index],[Index]+1), LOOKUPVALUE([Weekday],[Index],[Index]+1)),
LOOKUPVALUE([Date Created],[Index],[Index]+1),BLANK())
Solved! Go to Solution.
@Anonymous
is this what you want?
New Start Time = MINX(FILTER('Table','Table'[Username ]=EARLIER('Table'[Username ])&&'Table'[ Weekday ]=EARLIER('Table'[ Weekday ])&&'Table'[Date Created]>EARLIER('Table'[Date Created])),'Table'[Date Created])
Proud to be a Super User!
Hi @Anonymous ,
Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!
Hope it helps,
Community Support Team _ Caitlyn
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Don't worry I ended up splitting the data so it was one user per list and it works fine.
@Anonymous
could you pls provide some sample data and expected output?
Proud to be a Super User!
The expected result would look something like the below. But what's happening at the moment is inconsistent where the blanks are or should be.
Date Created Username Weekday Index New Start Time
03/01/2020 09:49:26 Abs 6 1 03/01/2020 10:07:05
03/01/2020 10:07:05 Abs 6 2 03/01/2020 10:35:22
03/01/2020 10:35:22 Abs 6 3
03/01/2020 16:10:51 Tod 6 4 03/01/2020 16:16:47
03/01/2020 16:16:47 Tod 6 5
06/01/2020 09:50:30 Tod 2 6 06/01/2020 10:16:23
06/01/2020 10:16:23 Tod 2 7 06/01/2020 10:27:15
06/01/2020 10:27:15 Tod 2 8
06/01/2020 10:37:13 Del 2 9 06/01/2020 10:58:21
06/01/2020 10:58:21 Del 2 10
@Anonymous
is this what you want?
New Start Time = MINX(FILTER('Table','Table'[Username ]=EARLIER('Table'[Username ])&&'Table'[ Weekday ]=EARLIER('Table'[ Weekday ])&&'Table'[Date Created]>EARLIER('Table'[Date Created])),'Table'[Date Created])
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |