Forum Discussion
Wadda7AboUdai
Helper I
2 years agocalculate days count between 2 dates
Hello Everyone I want to calculate days starts with item purchese date to item transfer date , items can be more than ones in the table it means can be purchesd more than ones and for all branches ...
Anonymous
2 years agoNot applicable
Hi Wadda7AboUdai ,
lbendlin , thanks for your attention to this situation. I tried to modify the data myself and implement the result according to the user's request. Please check if it can be improved. Here is my solution:
1. create a calculated column to get the number of days between intervals.
Days Count =
VAR PurchaseDate = CALCULATE(MIN('Table'[date]), 'Table'[decs] = "purchase", ALLEXCEPT('Table', 'Table'[item], 'Table'[branch],'Table'[transaction number]))
VAR TransferDate = CALCULATE(MAX('Table'[date]), 'Table'[decs] = "transfer", ALLEXCEPT('Table', 'Table'[item], 'Table'[branch],'Table'[transaction number]))
RETURN
DATEDIFF(PurchaseDate, TransferDate, DAY)
2. Create a calculation table to get the desired result.
Summary Table =
var _table=
SUMMARIZE(
'Table',
'Table'[item],
'Table'[transaction number],
'Table'[branch],
'Table'[Days Count]
)
return
FILTER(
_table,[Days Count]<>BLANK())
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Wadda7AboUdai
Helper I
2 years agoHi Anonymous
thank you for your help
the table shows nothing , I think I did some thing wrong
the categoryreferance 3= purchse , 22 = transfer