Forum Discussion
vytas
Helper I
6 years agoMin/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
Mariusz
Community Champion
6 years agoHi 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 - __min
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.