Forum Discussion

Russ99's avatar
Russ99
Helper I
4 years ago
Solved

dax formula

Hi Community,   I need some help writing a formula that will calculate when a customer is meant to pay for an item. The date they are meant to pay depends on 2 things, how many days their payment t...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Russ99 ,

     

    My sample is as below.

    Table1:

    Table2:

    Relationship:

    Measure:

    date customer meant to pay =
    VAR _Payment_terms =
        SUM ( Table2[payment terms] )
    VAR _net_or_eom =
        MAX ( Table2[net or eom] )
    VAR _Transaction_Date =
        MAX ( Table1[Transaction Date] )
    RETURN
        IF (
            _net_or_eom = "net",
            _Transaction_Date + _Payment_terms,
            EOMONTH ( _Transaction_Date, 0 ) + _Payment_terms
        )

    Result is as below.

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.