Forum Discussion

balu810's avatar
balu810
Advocate I
4 years ago
Solved

Caluclated Column for Year

I have project start date in one table and i created date table which have continuous dates and i extrated year out of it .    I have several projects which have which starts in one year and ends i...
  • parry2k's avatar
    4 years ago

    balu810 add a new column for Year Cohort using the following DAX expression and then use the new column on columns in matrix visual.

     

    Cohort Year = 
    VAR __startYear = CALCULATE ( MIN ( 'Table'[Date] ), ALLEXCEPT ( 'Table','Table'[Project ] ) )
    RETURN DATEDIFF ( __startYear, 'Table'[Date], YEAR ) + 1

     

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.