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,
Based on your description, it sounds like compare current records and previous records.
Can you please share some sample data for further test and analysis?
You can also take a look at below link which has the similar requirement:
Regards,
Xiaoxin Sheng
- Anonymous8 years agoNot applicable
Anonymous
Sure, here it is:
Sample
- Anonymous8 years agoNot applicable
Hi Anonymous,
Can you please share pbix/excel file with some fake data? I will test on it.(it is trouble to manual input your data from the screenshots)
Regards,
Xiaoxin Sheng
- Anonymous8 years agoNot applicable
Sorry Anonymous, I've been away.
Here is the file.
https://www.dropbox.com/s/wnhwj2ch1r5cfia/Test.pbix?dl=0
Thank you!