Forum Discussion

brief001's avatar
brief001
Icon for Helper II rankHelper II
5 years ago
Solved

Create grouped table from date field

I want to create a table from another table. This table must group the records whose unique record must be preserved based on a date field. In the table you see John in double, my result should be th...
  • mahoneypat's avatar
    5 years ago

    Please use this table expression.

     

    NewTable =
    ADDCOLUMNS (
        DISTINCT ( Team[Name] ),
        "Date",
            CALCULATE (
                LASTNONBLANK (
                    Team[Date],
                    MIN ( Team[Date] )
                )
            ),
        "Team",
            CALCULATE (
                LASTNONBLANKVALUE (
                    Team[Date],
                    MIN ( Team[Team] )
                )
            )
    )

     

    Pat

  • wdx223_Daniel's avatar
    5 years ago

    Table=FILTER(SampleData,SampleData[Date]=CALCULATE(MAX(SampleData[Date]),ALLEXCEPT(SampleData,SampleData[Name])))