Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +-----------+-----------+------------------+-----------------------+
- | invoiceId | CompanyId | InvoiceDate | Closest Earlier Date |
- +-----------+-----------+------------------+-----------------------+
- | 103111 | 219660 | 2018-04-30 00:00 | null |
- | 555056 | 219662 | 2019-02-12 00:00 | null |
- | 347454 | 219668 | 2018-09-28 00:00 | 2018-08-31 00:00 |
- | 402587 | 219668 | 2018-10-31 00:00 | 2018-09-28 00:00 |
- | 311889 | 219668 | 2018-08-31 00:00 | 2018-06-20 00:00 |
- | 179054 | 219668 | 2018-06-20 00:00 | 2018-06-12 00:00 |
- | 169563 | 219668 | 2018-06-12 00:00 | null |
- | 167041 | 319670 | 2018-06-08 00:00 | 2018-06-01 00:00 |
- | 572585 | 319670 | 2019-02-21 00:00 | 2018-06-01 00:00 |
- | 144796 | 319670 | 2018-06-01 00:00 | null |
- | 103274 | 319671 | 2018-04-30 00:00 | null |
- | 210641 | 319671 | 2018-07-06 00:00 | 2018-04-30 00:00 |
- +-----------+-----------+------------------+-----------------------+
- ClosestEarlierInvoiceDate =
- CALCULATE(
- MIN('Invoices'[InvoiceDate]);
- FILTER('Invoices';EARLIEST('CW-Invoices'[InvoiceDate]))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement