<?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: Column - Extract Month and Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3880398#M151475</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;If the prefix and suffix are fixed, you can do something like this in DAX:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In plain text for convenience:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column as Date = DATEVALUE ( SUBSTITUTE ( LEFT ( SUBSTITUTE ( [Column], "abc_tef_ghit_", "" ), 7 ), "_", "/" ) )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2024 18:25:17 GMT</pubDate>
    <dc:creator>barritown</dc:creator>
    <dc:date>2024-04-30T18:25:17Z</dc:date>
    <item>
      <title>Column - Extract Month and Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3879459#M151448</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the below data in a column :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Column&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abc_tef_ghit_04_2022_1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abc_tef_ghit_05_2022_1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abc_tef_ghit_06_2022_1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abc_tef_ghit_07_2022_1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;abc_tef_ghit_08_2022_1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Required output :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Column&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Apr-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;May-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jun-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jul-22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Aug-24&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 12:26:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3879459#M151448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-30T12:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Column - Extract Month and Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3880398#M151475</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;If the prefix and suffix are fixed, you can do something like this in DAX:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In plain text for convenience:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column as Date = DATEVALUE ( SUBSTITUTE ( LEFT ( SUBSTITUTE ( [Column], "abc_tef_ghit_", "" ), 7 ), "_", "/" ) )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 18:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3880398#M151475</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2024-04-30T18:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Column - Extract Month and Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3881744#M151514</link>
      <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;You can easily transform your column in Power Query .&lt;BR /&gt;USE THIS, Extract the text you want , replace _ to - and then change data type to text .&lt;BR /&gt;After that insert year , month column and then merge them.&amp;nbsp;=&lt;BR /&gt;&lt;STRONG&gt;Text.Middle([Column], 'Start index','end index' )&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSkxKji9JTYtPz8gsiTcwiTcyMDKKN1SK1UGXMsUtZYZbyhy3lAWylIJSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Middle([Column1], 13, 7)),
    #"Replaced Value" = Table.ReplaceValue(#"Added Custom","_","-",Replacer.ReplaceText,{"Custom"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Custom", type date}}),
    #"Inserted Month Name" = Table.AddColumn(#"Changed Type1", "Month Name", each Date.MonthName([Custom]), type text),
    #"Inserted Year" = Table.AddColumn(#"Inserted Month Name", "Year", each Date.Year([Custom]), Int64.Type),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Inserted Year", {{"Year", type text}}, "en-IN"),{"Month Name",  "Year"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post helps ,&lt;STRONG&gt;&lt;EM&gt; ACCEPT IT AS SOLUTION&lt;/EM&gt;&lt;/STRONG&gt; , so others can find it easily.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 08:02:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-Extract-Month-and-Year/m-p/3881744#M151514</guid>
      <dc:creator>manvishah17</dc:creator>
      <dc:date>2024-05-01T08:02:30Z</dc:date>
    </item>
  </channel>
</rss>

