Forum Discussion

ammar_cs_2004's avatar
ammar_cs_2004
Frequent Visitor
4 years ago
Solved

How to create start and end date columns from date column in Power BI?

I need to make the start date and end date columns from the date column. I have a table of Asset transfer  Example Input:   Vr. No. Vr. Date Transaction Name Asset Code To Code To Name ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi ammar_cs_2004,

    You can try to use the following calculate column formula to get the end date:

    EndDate =
    VAR nextDate =
        CALCULATE (
            MIN ( 'Table'[Vr. Date] ),
            FILTER (
                'Table',
                [Asset Code] = EARLIER ( 'Table'[Asset Code] )
                    && [Vr. Date] > EARLIER ( 'Table'[Vr. Date] )
            )
        )
    RETURN
        IF ( nextDate <> BLANK (), nextDate - 1, TODAY () )

    Regards,

    Xiaoxin Sheng