Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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] ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |