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.
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))
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |