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 ...
tamerj1
Community Champion
2 years agoWadda7AboUdai
Yes that is because in expected result that you have presented, the transaction number is part of the filter context. If you place the transaction number in the result summary table it should work. However, the following should work in both senarios.
Days Count =
SUMX (
SUMMARIZE (
'inventtransn',
'inventtransn'[item],
'inventtransn'[transaction number]
),
VAR PurchaseDate =
CALCULATE (
MIN ( 'inventtransn'[DATEPHYSICAL] ),
'inventtransn'[REFERENCECATEGORY] = 3
)
VAR TransferDate =
CALCULATE (
MAX ( 'inventtransn'[DATEPHYSICAL] ),
'inventtransn'[REFERENCECATEGORY] = 22
)
RETURN
IF (
NOT ISBLANK ( TransferDate ),
DATEDIFF ( PurchaseDate, TransferDate, DAY )
)
)Wadda7AboUdai
Helper I
2 years ago- tamerj12 years ago
Community Champion
Can you please add the [VOUCHER] column to the detailed table visual and share a screenshot?
- Wadda7AboUdai2 years ago
Helper I
showed Blank
- tamerj12 years ago
Community Champion
I meant in the detailed table not the in tge summary table.