Forum Discussion
How to create a new formatted YYYY-YY column based on the row's date month value?
- 6 years ago
Hi D_PBI ,
Lot of work! I wonder if you meant 7 or greater thus splitting the year in half. If so, change the code at the beginning replacing the 6 with 7.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathanielif Date.Month ([Column1])<6 then Text.Combine({ Text.From( Number.From( Text.End( Date.ToText([Column1] ),4))-1),Text.From( Number.From( Text.End( Date.ToText([Column1]),2)))},"-" ) else Text.Combine({ Text.From( Number.From( Text.End( Date.ToText([Column1] ),4))),Text.From( Number.From( Text.End( Date.ToText([Column1]),2))+1)},"-" )
Hi D_PBI ,
Lot of work! I wonder if you meant 7 or greater thus splitting the year in half. If so, change the code at the beginning replacing the 6 with 7.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
if Date.Month ([Column1])<6 then Text.Combine({
Text.From( Number.From( Text.End( Date.ToText([Column1] ),4))-1),Text.From( Number.From( Text.End( Date.ToText([Column1]),2)))},"-" ) else Text.Combine({
Text.From( Number.From( Text.End( Date.ToText([Column1] ),4))),Text.From( Number.From( Text.End( Date.ToText([Column1]),2))+1)},"-" )
Hi,
Think that when using 'Number' component, you'll hit problems with leading zeroes. I.e. 2008/09 will appear as 2008/9.
Alternate method (Australian Financial Year Jul-Jun) -