Forum Discussion

igorabdo's avatar
igorabdo
Advocate II
8 years ago
Solved

Sum Days

Hi everybody
I'm try to understand a query with date.
I'm working with financial data.
I've three bank.
Bank 1
Bank 2
Bank 3
And I receive this
Bank 1 - Receipts one day after maturity = D + 1
Bank 2 - Receipts one day after expiration = D + 1
Bank 3 - Receipts three days after maturity = D + 3

But my question is:
How I sum days.
I try dateadd but isn't funciont.
I want to take the date and sum more days.
For example.
If bank = bank 1; sum 3 days.....

 

Thanks Powers

  • Hi!!! 
    I got it!

    It's simple.

    I use M language.

     

    if [Banco] = "Safra" then Date.AddDays([Data pagamento],1) else Date.AddDays([Data pagamento],3)

     

    Date.AddDays save me

     

    Thanks everyone

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    igorabdo,

    Could you please share sample data of your table and post expected result based  on the sample data here?

    Regards,
    Lydia

      • alexei7's avatar
        alexei7
        Continued Contributor

        Hi igorabdo,

         

        Sorry, I've looked at your model and your posts and still don't understand your requirement.

         

        Perhaps you could fill out the column with your expected result to help us understand what you're trying to do

         

        Thanks

        Alex