Forum Discussion

jrpoli2000's avatar
jrpoli2000
Frequent Visitor
8 years ago
Solved

Value adjustment

 

Can anyone please help me with 2 measures or calculated columns to make adjustments on INVOICE PAYMENT and PENDING columns. ADJUSTED INVOICE PAYMENT column will only calculate the rows with negative amounts on the PENDING column by adding INVOICE PAYMENT column and PENDING column while those with non-negative amount will reain as it is.

 

Below is the the data table and the expected output for the 2 measures.

 

DATA TABLE   
INVOICE NOINVOICE AMTINVOICE PAYMENTPENDING
135.0736-0.93
2450.8445.934.87
3576576.88-0.88

 

 

Expected output :

MEASURE 1MEASURE 2
ADJUSTED INVOICE PAYMENTADJUSTED PENDING
35.070
445.934.87
5760

 


 Thanks!!!

  • Not an amazingly elegant solution, but this should work:

     

    Add two calculated columns as below - 

     

    Adjusted Invoice Payment = IF ( Pending < 0 , InvoicePayment - Pending, InvoicePayment )

     

    Adjusted Pending = IF ( Pending < 0, 0, Pending )

     

    Hope this helps!

     

2 Replies

  • Not an amazingly elegant solution, but this should work:

     

    Add two calculated columns as below - 

     

    Adjusted Invoice Payment = IF ( Pending < 0 , InvoicePayment - Pending, InvoicePayment )

     

    Adjusted Pending = IF ( Pending < 0, 0, Pending )

     

    Hope this helps!

     

    • jrpoli2000's avatar
      jrpoli2000
      Frequent Visitor

      Thanks a lot!!! You just cured my weeklong headache:smileyhappy: