Forum Discussion
saanah2019
7 years agoHelper II
Subtract datetime from a column
Hi, so I have a datetime field in a column and I just want to create a new column/measure which subtracts the previous entry if the dates are the same. I have time and I want to calculate the dif...
Ashish_Mathur
7 years agoSuper User
Hi,
Try these calculated column formulas:
Date = INT(Data[time])
Diff = if(ISBLANK(CALCULATE(MAX(Data[time]),FILTER(Data,Data[Date]=EARLIER(Data[Date])&&Data[time]<EARLIER(Data[time])))),BLANK(),Data[time]-CALCULATE(MAX(Data[time]),FILTER(Data,Data[Date]=EARLIER(Data[Date])&&Data[time]<EARLIER(Data[time]))))
Hope this helps.
- saanah20197 years agoHelper II
thanks but how would i do this in Power BI?
- Ashish_Mathur7 years agoSuper User
Hi,
Ensure the Excel file is closed. Open PBI desktop and go to File > Import > Excel.
Hope this helps.