1

I was wondering if you could help me to convert the data format per below: 01/01/2018 to Jan 18 09/30/2018 to Q3 18

=Table.AddColumn(#"Removed Columns2", "Custom", each Date.ToText([Report Date],"MMM")&"-"&Date.Year([Report Date],"YY"))

This is what I have tried so far and no results:

Thank you very much for your help!

Olly
  • 7,749
  • 1
  • 19
  • 38
zofia
  • 91
  • 1
  • 1
  • 3
  • Hi Zofia, welcome to StackOverflow! It looks like you were starting to write what you've already tried, and possibly forgot to finish? That might be helpful to people trying to answer (and it shows you've put in work to try to solve the problem, which is generally appreciated here), so do try to finish that off if you have time. Apologies if you're already in the midst of doing so! – Ashley Davies Feb 26 '19 at 22:59

1 Answers1

3

You're nearly there.

Try

Custom1 = Table.AddColumn(#"Removed Columns2", "MMM-YY", each Date.ToText([Report Date],"MMM-yy")),
Custom2 = Table.AddColumn(#"Custom1", "QYY", each Number.ToText(Date.QuarterOfYear([Report Date])) & Date.ToText([Report Date], "yy"))
Olly
  • 7,749
  • 1
  • 19
  • 38
  • Thank you so so much for taking time to help me! Please see my comments below! Once again, I greatly appreciate it! Custom1 works! = Table.AddColumn(#"Unpivoted Columns", "Custom", each Date.ToText([Report Date],"MMM") &" "& Date.ToText([Report Date], "yy") – zofia Feb 27 '19 at 17:32
  • for Custom2 for below, I am getting following error: Token EOF expected Custom2 = Table.AddColumn(#"Custom1", "QYY", each Number.ToText(Date.QuarterOfYear([Report Date])) & Date.ToText([Report Date], "yy")) I have also tried this: "Q"&Text.From(Date.QuarterOfYear([Report Date]))&" "&Date.ToText([Report Date], "YY")) ==> Q2 YY but gives YY instead of 18. is it a glitch? I used exact same Part2 of the string like in Custom1 and it works but it is not working for this custom2. Thank you for your help!! – zofia Feb 27 '19 at 17:34
  • Power Query is case sensitive: `YY` is different to `yy`. – Olly Feb 27 '19 at 17:52
  • Thank you so much it worked! "Q"&Text.From(Date.QuarterOfYear([Report Date]))&" "&Date.ToText([Report Date], "yyyy")) ---> Q2 2018 – zofia Mar 07 '19 at 23:32