Forum Discussion
Gazsim44
6 years agoHelper III
Add 'Order Raised' column
Hi, I have a report I am building which in basic form consists of a Job No, Invoice No and Invoice Date. There can be several invoice's on one job and then also several dates etc. Is there a way ...
- Anonymous6 years ago
To order on dates first, invoice number second:
[Order Raised] = COUNTROWS ( FILTER ( ALL ( 'Table' ), 'Table'[Job No.] = EARLIER ( 'Table'[Job No.] ) && ( 'Table'[Invoice Date.] < EARLIER ( 'Table'[Invoice Date.] ) || ( 'Table'[Invoice Date.] = EARLIER ( 'Table'[Invoice Date.] ) && 'Table'[Invoice No.] <= EARLIER ( 'Table'[Invoice No.] ) ) ) ) )
Gazsim44
6 years agoHelper III
Hi George,
Thanks but doesnt seems to be quite right in terms of the results. Let me give you a live example based on this calculation;
Many thanks
| Invoice No. | Invoice Date. | Job No. | Order (based on calculated column) | Correct Order |
| 59202682 | 08/11/19 | 802690xxxx | 3 | 3 |
| 52142778 | 07/11/19 | 802690xxxx | 1 | 1 |
| 52143014 | 08/11/19 | 802690xxxx | 2 | 2 |
| 52148123 | 05/12/19 | 802690xxxx | 3 | 4 |
| 59203181 | 05/12/19 | 802690xxxx | 5 | 5 |