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
Mariusz
6 years agoCommunity Champion
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 - __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.