Forum Discussion
Difference Between First Bill, Second Bill & Last Bill
- 5 years ago
Anonymous
If you were to use DAX and a calculated column here below is the DAX you could use:
TimeDiff =
VAR mobileNum = [Mobile #]
VAR billDate = [Date]
VAR billTime = [Bill Time]
VAR firstBillTime =
CALCULATE (
MIN ( [Bill Time] ),
FILTER (
TableBills,
TableBills[Mobile #] = mobileNum
&& TableBills[Date] = billDate
)
)
RETURN
IF ( firstBillTime = billTime, TIME ( 0, 0, 0 ), billTime - firstBillTime )However, passing by Power Query might be a better approach to add a column
Let us know if that works for you
David
Anonymous
If you were to use DAX and a calculated column here below is the DAX you could use:
TimeDiff =
VAR mobileNum = [Mobile #]
VAR billDate = [Date]
VAR billTime = [Bill Time]
VAR firstBillTime =
CALCULATE (
MIN ( [Bill Time] ),
FILTER (
TableBills,
TableBills[Mobile #] = mobileNum
&& TableBills[Date] = billDate
)
)
RETURN
IF ( firstBillTime = billTime, TIME ( 0, 0, 0 ), billTime - firstBillTime )
However, passing by Power Query might be a better approach to add a column
Let us know if that works for you
David
- Anonymous5 years agoNot applicable
It is working bro.
Thank you so much for your time and effort.
In case of any additional requirement i will get back to you.