Search code examples
powerbidaxpowerbi-desktoppowerbi-datasource

Create new table using last row of other table in power BI


I have following table AllIterationTable

AreaPath IterationPath StartDate EndDate
power power - Sprint1 08-03-2021 00:00 13-03-2021 00:00
power power - Sprint 3 15-03-2021 00:00 20-03-2021 00:00
power power - Migration 22-03-2021 00:00 27-03-2021 00:00
power power - License 29-03-2021 00:00 03-04-2021 00:00

I want to get whole row based on latest date of StartDate column. I expect output, LastRowTable,

AreaPath IterationPath StartDate EndDate
power power - License 29-03-2021 00:00 03-04-2021 00:00

Solution

  • Try the calculated table as follows:

    MyTable=
    VAR maxDate = CALCULATE( MAX( AllIterationTable[StartDate] ), ALL( AllIterationTable ) )
    VAR result =
    FILTER( 
       AllIterationTable, 
       AllIterationTable[StartDate] = maxDate
    )
    RETURN
       result