Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have the following table:
CUSTOMER | INVOICE DATE |
AAA | 14/02/2014 |
BBB | 14/06/2012 |
CCC | 13/02/2016 |
AAA | 15/03/2015 |
DDD | 10/06/2013 |
EEE | 20/12/2016 |
BBB | 06/08/2013 |
CCC | 22/09/2014 |
AAA | 22/10/2016 |
BBB | 14/11/2015 |
I want a column calculated with the year of the oldest invoice, and another column with the year of the most recent invoice.
CUSTOMER | INVOICE DATE | OLDEST INVOICE | MOST RECENT INVOICE |
AAA | 14/02/2014 | 2014 | 2016 |
BBB | 14/06/2012 | 2012 | 2015 |
CCC | 13/02/2016 | 2014 | 2016 |
AAA | 15/03/2015 | 2014 | 2016 |
DDD | 10/06/2013 | 2013 | 2013 |
EEE | 20/12/2016 | 2016 | 2016 |
BBB | 06/08/2013 | 2012 | 2015 |
CCC | 22/09/2014 | 2014 | 2016 |
AAA | 22/10/2016 | 2014 | 2016 |
BBB | 14/11/2015 | 2012 | 2015 |
Thank you very much and best regards.
Solved! Go to Solution.
Hi @Isidro
This shall get you the oldest invoice
= CALCULATE ( YEAR ( MIN ( [INVOICE DATE] ) ), FILTER ( Table1, Table1[CUSTOMER] = EARLIER ( Table1[CUSTOMER] ) ) )
Hi @Isidro
This shall get you Most Recent Invoice
= CALCULATE ( YEAR ( MAX ( [INVOICE DATE] ) ), FILTER ( Table1, Table1[CUSTOMER] = EARLIER ( Table1[CUSTOMER] ) ) )
Hi @Isidro
This shall get you Most Recent Invoice
= CALCULATE ( YEAR ( MAX ( [INVOICE DATE] ) ), FILTER ( Table1, Table1[CUSTOMER] = EARLIER ( Table1[CUSTOMER] ) ) )
Hi @Isidro
This shall get you the oldest invoice
= CALCULATE ( YEAR ( MIN ( [INVOICE DATE] ) ), FILTER ( Table1, Table1[CUSTOMER] = EARLIER ( Table1[CUSTOMER] ) ) )
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |