Forum Discussion
axk180022
4 years agoHelper II
Calculate Difference between 2 rows based on another column filter
I would want to find the difference in the GenHours for each serialid. Currently this is how my table looks on power BI. I have filtered the latest and 2nd latest date for each serialid. ...
- 4 years ago
Hi,
This calculated column formula works
=if(CALCULATE(MAX(Data[Dates]),FILTER(Data,Data[serialid]=EARLIER(Data[serialid])))=Data[Dates],ABS(Data[GenHours]-LOOKUPVALUE(Data[GenHours],Data[Dates],CALCULATE(max(Data[Dates]),FILTER(Data,Data[serialid]=EARLIER(Data[serialid])&&Data[Dates]<EARLIER(Data[Dates]))),Data[serialid],Data[serialid])),BLANK())Hope this helps.
Ashish_Mathur
4 years agoSuper User
You are welcome. I do not understand your requirement. Please show the expected result very clearly.
DarrelDonatto
4 years agoFrequent Visitor
I am looking to get the maximum unit response time to appear on the line for the incident ID. Currently, I am getting the minimum time for all incident ids. For this case, instead of the 6:50 it should show 13:57.
- Ashish_Mathur4 years agoSuper User
Hi,
Try this measure
Response time_new = MAXX(Values(Data[Inci_id]),[Response time])
Hope this helps.
- DarrelDonatto4 years agoFrequent Visitor
That is still giving me the least or minimum time of all units for that Incident under the Incident ID row. I am trying to get the maximum time.
- Ashish_Mathur4 years agoSuper User
Hi,
Share the link from where i can download your PBI file.