Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. +-----------+-----------+------------------+-----------------------+
  2. | invoiceId | CompanyId | InvoiceDate | Closest Earlier Date |
  3. +-----------+-----------+------------------+-----------------------+
  4. | 103111 | 219660 | 2018-04-30 00:00 | null |
  5. | 555056 | 219662 | 2019-02-12 00:00 | null |
  6. | 347454 | 219668 | 2018-09-28 00:00 | 2018-08-31 00:00 |
  7. | 402587 | 219668 | 2018-10-31 00:00 | 2018-09-28 00:00 |
  8. | 311889 | 219668 | 2018-08-31 00:00 | 2018-06-20 00:00 |
  9. | 179054 | 219668 | 2018-06-20 00:00 | 2018-06-12 00:00 |
  10. | 169563 | 219668 | 2018-06-12 00:00 | null |
  11. | 167041 | 319670 | 2018-06-08 00:00 | 2018-06-01 00:00 |
  12. | 572585 | 319670 | 2019-02-21 00:00 | 2018-06-01 00:00 |
  13. | 144796 | 319670 | 2018-06-01 00:00 | null |
  14. | 103274 | 319671 | 2018-04-30 00:00 | null |
  15. | 210641 | 319671 | 2018-07-06 00:00 | 2018-04-30 00:00 |
  16. +-----------+-----------+------------------+-----------------------+
  17.  
  18. ClosestEarlierInvoiceDate =
  19. CALCULATE(
  20. MIN('Invoices'[InvoiceDate]);
  21.  
  22. FILTER('Invoices';EARLIEST('CW-Invoices'[InvoiceDate]))
  23. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement