Forum Discussion

ngadiez's avatar
ngadiez
Helper II
9 years ago
Solved

Get Date Value from Parameters

I have 2 parameters where I get the 'Valuation Year' and 'Valuation Month'   I want to use these 2 parameters to add custom Column:   This is my code: I want to get the difference in month: Numb...
  • MarcelBeug's avatar
    MarcelBeug
    9 years ago

    If only year/month is relevant, then you can use the following code, in which <PreviousStep> is the name of the previous step in your query.

     

    = Table.AddColumn(<PreviousStep>, "Months", each 12*(ValuationYear-Date.Year([StartDate]))+ValuationMonth-Date.Month([StartDate]))