Forum Discussion

cdn4lf's avatar
cdn4lf
Frequent Visitor
7 years ago
Solved

Calculate End Date

Hi All,   I'm looking for some help in calculating an end date for the image below OR for a way to determine the correct fee amount based on the course_fee_id being the same AND the start date of t...
  • v-lili6-msft's avatar
    v-lili6-msft
    7 years ago

    hi, cdn4lf 

    You could use this formula to add a Effective_End_Date column in table 1, then create another column in table2

     

    Effective_End_Date =
    IF (
        CALCULATE (
            MIN ( Table1[Effective_Start_Date] ),
            FILTER (
                Table1,
                Table1[Fee_ID] = EARLIER ( Table1[Fee_ID] )
                    && Table1[Effective_Start_Date] > EARLIER ( Table1[Effective_Start_Date] )
            )
        )
            = BLANK (),
        DATE ( 9999, 12, 31 ),
        CALCULATE (
            MIN ( Table1[Effective_Start_Date] ),
            FILTER (
                Table1,
                Table1[Fee_ID] = EARLIER ( Table1[Fee_ID] )
                    && Table1[Effective_Start_Date] > EARLIER ( Table1[Effective_Start_Date] )
            )
        ) - 1
    )

    Best regards,
    Lin