Forum Discussion

Leslie1015's avatar
Leslie1015
Frequent Visitor
3 years ago
Solved

Need Help Creating Start and End Date Column in Power BI

Hi everyone,   I'm new to power BI, can somebody help me on how to create a start and end date in power BI. This is the data I have   Date Wed, 01 Mar 2023 07:00:53 Wed, 01 Mar 2023 07:...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Leslie1015,

    You can create two calculate columns to achieve your requirement. The start date reference from the raw date field, the end date use current index field value to lookup the next row date value.

    StartDate= 'Table'[Date]
    
    EndDate = 
        CALCULATE(
            MAX('Table'[Date]),
            FILTER(
                ALL('Table'),
                'Table'[Index] = EARLIER('Table'[Index]) + 1
            )
        )

    Regards,

    Xiaoxin Sheng