March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
have a table of data with the structure below. The table is called 'machines'. The absoluteCount column keeps a tally of the count at the time of the dateTime column. I am trying to figure out how to create a new column with the increase in the count between the current absoluteCount value and the previous absoluteCount value by machineID. There are approximately 50 different machines that are tracked in this table.
With the times being down to the minute, I haven't come up with a good way to do this. Any help or directions would be appreciated.
Thanks
dateTime | machineID | absoluteCount |
8/20/2017 0:00 | machine02 | 1146051 |
8/20/2017 0:00 | machine01 | 443168 |
8/20/2017 1:00 | machine02 | 1146051 |
8/20/2017 1:00 | machine01 | 443168 |
8/20/2017 2:00 | machine02 | 1146051 |
8/20/2017 2:00 | machine01 | 443168 |
8/20/2017 3:00 | machine02 | 1146051 |
8/20/2017 3:00 | machine01 | 443168 |
8/20/2017 4:00 | machine02 | 1146051 |
8/20/2017 4:00 | machine01 | 443168 |
8/20/2017 5:00 | machine02 | 1146051 |
8/20/2017 5:00 | machine01 | 443168 |
8/20/2017 6:00 | machine02 | 1146051 |
8/20/2017 6:00 | machine01 | 443168 |
8/20/2017 7:00 | machine02 | 1146051 |
8/20/2017 7:00 | machine01 | 443168 |
8/20/2017 8:00 | machine02 | 1146051 |
8/20/2017 8:00 | machine01 | 443168 |
8/20/2017 9:00 | machine02 | 1146051 |
8/20/2017 9:00 | machine01 | 443168 |
8/20/2017 10:00 | machine02 | 1146051 |
8/20/2017 10:00 | machine01 | 443168 |
8/20/2017 11:00 | machine02 | 1146051 |
8/20/2017 11:00 | machine01 | 443168 |
8/20/2017 12:00 | machine02 | 1146051 |
8/20/2017 12:00 | machine01 | 443168 |
8/20/2017 13:00 | machine02 | 1146051 |
8/20/2017 13:00 | machine01 | 443168 |
8/20/2017 14:00 | machine02 | 1146051 |
8/20/2017 14:00 | machine01 | 443168 |
8/20/2017 15:00 | machine02 | 1146051 |
8/20/2017 15:00 | machine01 | 443168 |
8/20/2017 16:00 | machine02 | 1146051 |
8/20/2017 16:00 | machine01 | 443168 |
8/20/2017 17:00 | machine02 | 1146051 |
8/20/2017 17:00 | machine01 | 443168 |
8/20/2017 18:00 | machine02 | 1146051 |
8/20/2017 18:00 | machine01 | 443168 |
8/20/2017 19:00 | machine02 | 1146051 |
8/20/2017 19:00 | machine01 | 443168 |
8/20/2017 20:00 | machine02 | 1146051 |
8/20/2017 20:00 | machine01 | 443168 |
8/20/2017 21:00 | machine02 | 1146051 |
8/20/2017 21:00 | machine01 | 443168 |
8/20/2017 22:00 | machine02 | 1146051 |
8/20/2017 22:00 | machine01 | 443168 |
8/20/2017 23:00 | machine02 | 1146051 |
8/20/2017 23:00 | machine01 | 443168 |
8/21/2017 0:00 | machine02 | 1146051 |
8/21/2017 0:00 | machine01 | 443168 |
8/21/2017 1:00 | machine02 | 1146051 |
8/21/2017 1:00 | machine01 | 443168 |
8/21/2017 2:00 | machine02 | 1146051 |
8/21/2017 2:00 | machine01 | 443168 |
8/21/2017 3:00 | machine02 | 1146051 |
8/21/2017 3:00 | machine01 | 443168 |
8/21/2017 4:00 | machine02 | 1146051 |
8/21/2017 4:00 | machine01 | 443168 |
8/21/2017 5:00 | machine02 | 1146051 |
8/21/2017 5:00 | machine01 | 443168 |
8/21/2017 6:00 | machine02 | 1146051 |
8/21/2017 6:00 | machine01 | 443168 |
8/21/2017 7:00 | machine02 | 1146057 |
8/21/2017 7:00 | machine01 | 443168 |
8/21/2017 8:00 | machine02 | 1147775 |
8/21/2017 8:00 | machine01 | 443168 |
8/21/2017 9:00 | machine02 | 1150152 |
8/21/2017 9:00 | machine01 | 443168 |
8/21/2017 10:00 | machine02 | 1151552 |
8/21/2017 10:00 | machine01 | 443168 |
8/21/2017 11:00 | machine02 | 1154099 |
8/21/2017 11:00 | machine01 | 443168 |
8/21/2017 12:00 | machine02 | 1156869 |
8/21/2017 12:00 | machine01 | 443168 |
8/21/2017 13:00 | machine02 | 1158234 |
8/21/2017 13:00 | machine01 | 443168 |
8/21/2017 14:00 | machine02 | 1160631 |
8/21/2017 14:00 | machine01 | 443168 |
8/21/2017 15:00 | machine02 | 1160631 |
8/21/2017 15:00 | machine01 | 443168 |
8/21/2017 16:00 | machine02 | 1160631 |
8/21/2017 16:00 | machine01 | 443168 |
8/21/2017 17:00 | machine02 | 1160631 |
8/21/2017 17:00 | machine01 | 443168 |
8/21/2017 18:00 | machine02 | 1160631 |
8/21/2017 18:00 | machine01 | 443168 |
8/21/2017 19:00 | machine02 | 1160631 |
8/21/2017 19:00 | machine01 | 443168 |
8/21/2017 20:00 | machine02 | 1160631 |
8/21/2017 20:00 | machine01 | 443168 |
8/21/2017 21:00 | machine02 | 1160631 |
8/21/2017 21:00 | machine01 | 443168 |
8/21/2017 22:00 | machine02 | 1160631 |
8/21/2017 22:00 | machine01 | 443168 |
8/21/2017 23:00 | machine02 | 1160631 |
8/21/2017 23:00 | machine01 | 443168 |
8/22/2017 0:00 | machine02 | 1160631 |
8/22/2017 0:00 | machine01 | 443168 |
8/22/2017 1:00 | machine02 | 1160631 |
8/22/2017 1:00 | machine01 | 443168 |
8/22/2017 2:00 | machine02 | 1160631 |
8/22/2017 2:00 | machine01 | 443168 |
8/22/2017 3:00 | machine02 | 1160631 |
8/22/2017 3:00 | machine01 | 443168 |
8/22/2017 4:00 | machine02 | 1160631 |
8/22/2017 4:00 | machine01 | 443168 |
8/22/2017 5:00 | machine02 | 1160631 |
8/22/2017 5:00 | machine01 | 443168 |
8/22/2017 6:00 | machine02 | 1160631 |
8/22/2017 6:00 | machine01 | 443168 |
8/22/2017 7:00 | machine02 | 1160637 |
8/22/2017 7:00 | machine01 | 443168 |
8/22/2017 8:00 | machine02 | 1161689 |
8/22/2017 8:00 | machine01 | 443168 |
8/22/2017 9:05 | machine02 | 1164295 |
8/22/2017 9:05 | machine01 | 443168 |
8/22/2017 10:00 | machine02 | 1164878 |
8/22/2017 10:00 | machine01 | 443168 |
8/22/2017 11:00 | machine02 | 1167029 |
8/22/2017 11:00 | machine01 | 443168 |
8/22/2017 12:00 | machine02 | 1169544 |
8/22/2017 12:00 | machine01 | 443168 |
8/22/2017 13:00 | machine02 | 1170464 |
8/22/2017 13:00 | machine01 | 443168 |
8/22/2017 14:00 | machine02 | 1173607 |
8/22/2017 14:00 | machine01 | 443168 |
8/22/2017 15:00 | machine02 | 1175815 |
8/22/2017 15:00 | machine01 | 443168 |
8/22/2017 16:00 | machine02 | 1176001 |
8/22/2017 16:00 | machine01 | 443168 |
8/22/2017 17:00 | machine02 | 1176001 |
8/22/2017 17:00 | machine01 | 443168 |
8/22/2017 18:00 | machine02 | 1176001 |
8/22/2017 18:00 | machine01 | 443168 |
8/22/2017 19:00 | machine02 | 1176001 |
8/22/2017 19:00 | machine01 | 443168 |
8/22/2017 20:00 | machine02 | 1176001 |
8/22/2017 20:00 | machine01 | 443168 |
8/22/2017 21:00 | machine02 | 1176001 |
8/22/2017 21:00 | machine01 | 443168 |
8/22/2017 22:00 | machine02 | 1176001 |
8/22/2017 22:00 | machine01 | 443168 |
8/22/2017 23:00 | machine02 | 1176001 |
8/22/2017 23:00 | machine01 | 443168 |
8/23/2017 0:00 | machine02 | 1176001 |
8/23/2017 0:00 | machine01 | 443168 |
8/23/2017 1:00 | machine02 | 1176001 |
8/23/2017 1:00 | machine01 | 443168 |
8/23/2017 2:00 | machine02 | 1176001 |
8/23/2017 2:00 | machine01 | 443168 |
8/23/2017 3:00 | machine02 | 1176001 |
8/23/2017 3:00 | machine01 | 443168 |
8/23/2017 4:00 | machine02 | 1176001 |
8/23/2017 4:00 | machine01 | 443168 |
8/23/2017 5:00 | machine02 | 1176001 |
8/23/2017 5:00 | machine01 | 443168 |
8/23/2017 6:00 | machine02 | 1176001 |
8/23/2017 6:00 | machine01 | 443168 |
8/23/2017 7:00 | machine02 | 1176007 |
8/23/2017 7:00 | machine01 | 443168 |
8/23/2017 8:01 | machine02 | 1177981 |
8/23/2017 8:01 | machine01 | 443168 |
8/23/2017 9:00 | machine02 | 1180157 |
8/23/2017 9:00 | machine01 | 443168 |
8/23/2017 10:00 | machine02 | 1181738 |
8/23/2017 10:00 | machine01 | 449335 |
8/23/2017 11:00 | machine02 | 1184519 |
8/23/2017 11:00 | machine01 | 449335 |
8/23/2017 12:00 | machine02 | 1186987 |
8/23/2017 12:00 | machine01 | 457458 |
Solved! Go to Solution.
I figred it out with help from other threads.
Created a Rank column to index each machineID by date, otherwise it would index the whole table regardless of machineID:
Rank =
VAR machineID = table[machineID]
RETURN
RANKX(
FILTER(
ALL(
table),table[machineID]=machineID), table[dateTime],,ASC)
Get Previous Day Value using the created Rank:
PreviousRowValue =
VAR Index = table[Rank] - 1
Return
CALCULATE(
MAX(table[absoluteCount]),
FILTER(ALLEXCEPT(table,table[machineID]),table[Rank] = Index))
I figred it out with help from other threads.
Created a Rank column to index each machineID by date, otherwise it would index the whole table regardless of machineID:
Rank =
VAR machineID = table[machineID]
RETURN
RANKX(
FILTER(
ALL(
table),table[machineID]=machineID), table[dateTime],,ASC)
Get Previous Day Value using the created Rank:
PreviousRowValue =
VAR Index = table[Rank] - 1
Return
CALCULATE(
MAX(table[absoluteCount]),
FILTER(ALLEXCEPT(table,table[machineID]),table[Rank] = Index))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |