Forum Discussion

thegusman's avatar
thegusman
Helper I
5 years ago
Solved

Creating a custom column and changing the data type within the custom column formula

Hi All, 

 

I'm trying to learn how I can create a custom column, let's use 

     =Date.EndOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1))

and within the same custom column formula make the data type date.

 

I'm trying to forgo adding the extra subsequent step of changing the data type. 

Is this possible?

 

 

  • Hi,

    Does this work?

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.EndOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1)), type date)

3 Replies

  • Hi,

    Does this work?

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.EndOfMonth(Date.AddMonths(DateTime.Date(DateTime.LocalNow()),-1)), type date)