Forum Discussion
vytas
6 years agoHelper I
Min/Max Dates
Hi, I have virtual table : Unpaid Invoices = FILTER ( ADDCOLUMNS ( SUMMARIZE ( Debt; Debt[DocumentNr]; Debt[CompanyNo]; Debt[Paym...
- 6 years ago
Hi vytas
Try something like this.
Measure = VAR __tbl = FILTER ( ADDCOLUMNS ( SUMMARIZE ( Debt; Debt[DocumentNr]; Debt[CompanyNo]; Debt[PaymentDay] ); "Saldo"; CALCULATE ( SUM ( Debt[Debt] ) ); "InvoiceDate"; CALCULATE ( MAX ( Debt[InvoiceDate] ) ) ); [Saldo] > 0 ) VAR __min = MINX( __tbl, [InvoiceDate] ) VAR __max = MAXX( __tbl, [InvoiceDate] ) RETURN __max - __minBest Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
amitchandak
6 years agoSuper User
vytas , you can get
Datediff(Min(Table[Date]),Max(Table[Date]),Day)
Refer this blog how to use row context to get correct date diff