Forum Discussion

gauravnarchal's avatar
gauravnarchal
Post Prodigy
6 years ago
Solved

Calculate Due date / Statement Date

Hello All I need your help in creating a measure from the below table.   Requirment If statement group is "M" result = EOMONTH + 1 + credit days   Example If statement group is "M" & Credit d...
  • v-kelly-msft's avatar
    5 years ago

    Hi gauravnarchal ,

     

    Create a measure as below:

    Measure =
    SWITCH (
        MAX ( 'Table'[statement group] ),
        "M",
            EOMONTH ( MAX ( 'Table'[invoice date] ), 0 ) + 1
                + MAX ( 'Table'[credit days] ),
        "F",
            IF (
                DAY ( MAX ( 'Table'[invoice date] ) ) <= 15,
                DATE ( YEAR ( MAX ( 'Table'[invoice date] ) ), MONTH ( MAX ( 'Table'[invoice date] ) ), 15 ) + 1
                    + MAX ( 'Table'[credit days] ),
                EOMONTH ( MAX ( 'Table'[invoice date] ), 0 ) + 1
                    + MAX ( 'Table'[credit days] )
            )
    )
    

    And you will see:

    For the related .pbix file ,pls see attached.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!