Forum Discussion
Anonymous
8 years agoNot applicable
Calculation over rows with condition
Hello all. I am trying to improve a file I have worked on. I need some calculations over rows with a condition, and I was not able to do them on the interface (DAX), so I created different tables...
- Anonymous8 years ago
Hi Anonymous,
If you want to get the summaried stop time you can try to add new measure with below formula:
Stop time(Summaried) = VAR temp = ADDCOLUMNS ( ALL ( Trips ), "Stoped Time", LOOKUPVALUE ( Trips[TripEndDateTime], Trips[VehicleID], [VehicleID], Trips[Date], [Date], Trips[Index], [Index] - 1 ) ) RETURN SUMX ( ADDCOLUMNS ( FILTER ( temp, [VehicleID] = MAX ( [VehicleID] ) && [Date] = MAX ( [Date] ) ), "Diff", DATEDIFF ( [Stoped Time], [TripStartDateTime], SECOND ) ), [Diff] )Regards,
Xiaoxin Sheng
Anonymous
8 years agoNot applicable
Hi Anonymous,
If you want to get the summaried stop time you can try to add new measure with below formula:
Stop time(Summaried) =
VAR temp =
ADDCOLUMNS (
ALL ( Trips ),
"Stoped Time", LOOKUPVALUE (
Trips[TripEndDateTime],
Trips[VehicleID], [VehicleID],
Trips[Date], [Date],
Trips[Index], [Index] - 1
)
)
RETURN
SUMX (
ADDCOLUMNS (
FILTER ( temp, [VehicleID] = MAX ( [VehicleID] ) && [Date] = MAX ( [Date] ) ),
"Diff", DATEDIFF ( [Stoped Time], [TripStartDateTime], SECOND )
),
[Diff]
)
Regards,
Xiaoxin Sheng
Anonymous
7 years agoNot applicable
Hi Xiaoxin Sheng
I am new to BI . I have simlar requirement wherein need ot get ATM idletime in a column against ATM Machine wherein no deposit or withdrawal hapened during operations time . For example 1:00 Am to 4 AM if there is no deposit or withdrawal then the column is populated with no. of hours smachine remained idle i.e no cash movement
Also I need a measure to get number of all such idle machines .
Can you help for both requirements ?
Pls see the image