<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: extract year from in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083160#M47293</link>
    <description>&lt;P&gt;yes&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 16:04:07 GMT</pubDate>
    <dc:creator>naveen73</dc:creator>
    <dc:date>2021-09-17T16:04:07Z</dc:date>
    <item>
      <title>extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083082#M47278</link>
      <description>&lt;P&gt;Hi all, I have a question on Power Query. I have a column that has some times dates in the right format e.g. 01/25/2025 and some times in the format e.g. Q3-2004. Is there a way I can write a code that will give me the correct year of the date for every entry?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nav&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:21:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083082#M47278</guid>
      <dc:creator>naveen73</dc:creator>
      <dc:date>2021-09-17T15:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083106#M47280</link>
      <description>&lt;P&gt;Hello there&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6957" data-lia-user-login="naveen73" class="lia-mention lia-mention-user"&gt;naveen73&lt;/a&gt;&amp;nbsp;! You have to select your date column in Power Query and use the "extract year" function as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And select Year -&amp;gt; Year and it will create a column with the year for every date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this answer solves your problem! If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, pleased mark it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or give it a kudoe &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/gon%C3%A7alo-costa-b32253159" target="_blank"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Gonçalo Geraldes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:32:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083106#M47280</guid>
      <dc:creator>goncalogeraldes</dc:creator>
      <dc:date>2021-09-17T15:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083124#M47286</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="301004" data-lia-user-login="goncalogeraldes" class="lia-mention lia-mention-user"&gt;goncalogeraldes&lt;/a&gt;&amp;nbsp;thanks for your swift response.&lt;/P&gt;&lt;P&gt;The cells with a value of "Q1-2002" give "null" with your proposed solution. I tried your solution in the first instance but did not work.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:51:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083124#M47286</guid>
      <dc:creator>naveen73</dc:creator>
      <dc:date>2021-09-17T15:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083146#M47290</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6957" data-lia-user-login="naveen73" class="lia-mention lia-mention-user"&gt;naveen73&lt;/a&gt;&amp;nbsp;is your data always in the format "QQ-YYYY"?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:59:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083146#M47290</guid>
      <dc:creator>goncalogeraldes</dc:creator>
      <dc:date>2021-09-17T15:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083152#M47291</link>
      <description>&lt;P&gt;that is exactly the problem, sometimes it is and sometimes it is not.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:01:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083152#M47291</guid>
      <dc:creator>naveen73</dc:creator>
      <dc:date>2021-09-17T16:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083158#M47292</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6957" data-lia-user-login="naveen73" class="lia-mention lia-mention-user"&gt;naveen73&lt;/a&gt;&amp;nbsp;are the year values always the last four?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083158#M47292</guid>
      <dc:creator>goncalogeraldes</dc:creator>
      <dc:date>2021-09-17T16:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083160#M47293</link>
      <description>&lt;P&gt;yes&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:04:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083160#M47293</guid>
      <dc:creator>naveen73</dc:creator>
      <dc:date>2021-09-17T16:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083161#M47294</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6957" data-lia-user-login="naveen73" class="lia-mention lia-mention-user"&gt;naveen73&lt;/a&gt;&amp;nbsp;I will assume that it is a text column so try this then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#"Added Custom" = Table.AddColumn(#"YourPreviousStep", "Year", each Text.End([ColumnName],4))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hope this answer solves your problem! If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, pleased mark it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or give it a kudoe &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/gon%C3%A7alo-costa-b32253159" target="_blank" rel="noopener"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Gonçalo Geraldes&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:31:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083161#M47294</guid>
      <dc:creator>goncalogeraldes</dc:creator>
      <dc:date>2021-09-17T16:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083530#M47323</link>
      <description>&lt;P&gt;Thanks for this solution. I meanwhile tried a different one:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;convert to text&lt;/LI&gt;&lt;LI&gt;take the last four characters&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, as I got the answer i.e. the last four digits realized that is not the answer I was looking for. What I am looking for is actually more complex.&lt;/P&gt;&lt;P&gt;For the values that have Q1, Q2 etc. I want the first day of that quarter in that year. For example: Q3-2007 should be 1 Oct 2007&lt;/P&gt;&lt;P&gt;Will that be possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 22:00:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2083530#M47323</guid>
      <dc:creator>naveen73</dc:creator>
      <dc:date>2021-09-17T22:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2086256#M47432</link>
      <description>&lt;P&gt;Hello there&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6957" data-lia-user-login="naveen73" class="lia-mention lia-mention-user"&gt;naveen73&lt;/a&gt;&amp;nbsp;! If I understood your situation correctly, I think this might give the result you are searching for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= Table.AddColumn(#"Your previous step", "Year", each if Text.Start([ColumnName],1) = "Q" then Date.StartOfQuarter(Text.Start([ColumnName],2)) else Text.End(Text.From([ColumnName], Culture.Current),4))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If you keep the column formatted as a Date it should work as well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this answer solves your problem! If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, pleased mark it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or give it a kudoe &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/gon%C3%A7alo-costa-b32253159" target="_blank" rel="noopener"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Gonçalo Geraldes&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 10:34:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2086256#M47432</guid>
      <dc:creator>goncalogeraldes</dc:creator>
      <dc:date>2021-09-21T10:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: extract year from</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2097770#M47830</link>
      <description>&lt;P&gt;Thanks so much for your help, It is appreciated!!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 21:28:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/extract-year-from/m-p/2097770#M47830</guid>
      <dc:creator>naveen73</dc:creator>
      <dc:date>2021-09-24T21:28:05Z</dc:date>
    </item>
  </channel>
</rss>

