Forum Discussion

Michalison's avatar
Michalison
Helper II
2 years ago
Solved

PowerBI Customn column

I want to add a custom column that looks at the completed date i.e. 22/06/2019 looks at years to next course column i.e. 3 then puts a new date in the custom column of 3 years since the completed date (or however many years are in the years until next course column) is this possible?  Mant thanks

  • Michalison 

    you can try to create a column in PQ (pls make sure the date is in date type)

    =Date.AddYears([Completed],[Years until next course])

     

    or use DAX to create a column

    Column = EDATE('Table'[Completed],'Table'[Years until next course]*12)
     
    pls see the attachment below

8 Replies

  • Michalison 

    you can try to create a column in PQ (pls make sure the date is in date type)

    =Date.AddYears([Completed],[Years until next course])

     

    or use DAX to create a column

    Column = EDATE('Table'[Completed],'Table'[Years until next course]*12)
     
    pls see the attachment below
  • Uzi2019's avatar
    Uzi2019
    Community Champion

    hi Michalison 
    Try calculated column 

    date new = DATE(YEAR(Sheet1[Date ])+Sheet1[Year Plus],MONTH(Sheet1[Date ]),DAY(Sheet1[Date ]))
     

     

     

    I hope I answered your question!

     

    • Michalison's avatar
      Michalison
      Helper II

      Thank you for your answer I have tried this but get an error

      It doesnt seem to like month/day etc

       

      • Uzi2019's avatar
        Uzi2019
        Community Champion

        Hi Michalison 

        Take the calculated column.
        right click on 3 dots > then select new column

         

        and write the formula which i have shared.