Forum Discussion
Add 'Order Raised' column
- 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.] ) ) ) ) )
Hi Gazsim44 ,
Can you please elaborate on the logic you want your "Order Raised" column to be calculated?
In the table screenshot, it is confusing. Why there is "1" appearing three times in "Order Raised" column?
Thanks,
Pragati
Hi Pragati,
The logic should be that following the job number (being the unique identifier for each file) the next column to look at would be invoice date as naturally anything raised for example on 1st Feb comes before 2nd Feb and so on.
To then be able to identify which invoice comes first if we have more than one raised on a single day we would then need to take into account the invoice number. These are issued in sequential invoice number so for example 111222 comes before 111223 and so on,
Hope this helps?
Thanks