Forum Discussion

PowerBI87's avatar
PowerBI87
Frequent Visitor
6 years ago
Solved

Return Earliest Year

HI Experts,   I am trying to have powerBI return the third column below:   It has to filter Project column, find all projects with the same name, and then return a yes for the earliest year.    ...
  • V-lianl-msft's avatar
    V-lianl-msft
    6 years ago

    Hi PowerBI87  ,

     

    You can also try using the allexcept function to calculate the minimum year for each project and compare it with the year of the current line.Try this measure:

    Measure =
    VAR min_year =
        CALCULATE (
            MIN ( 'Table'[Delivery Year] ),
            ALLEXCEPT ( 'Table', 'Table'[Project] )
        )
    RETURN
        IF ( MAX ( 'Table'[Delivery Year] ) = min_year, "Yes", "No" )

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.