<?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: How to delete everything after a dash and put the remaining text on 4 characters in DAX? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1827011#M38785</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your answer, I will look into it, but I would prefer to do it in Visual Studio with a calculated column without having to modify the Power BI part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have made two distinct columns that separate my two values, I have only one column your two columns separated by a dash like: 90-BLACK&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 09:20:20 GMT</pubDate>
    <dc:creator>matdub40</dc:creator>
    <dc:date>2021-05-06T09:20:20Z</dc:date>
    <item>
      <title>How to delete everything after a dash and put the remaining text on 4 characters in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1826878#M38781</link>
      <description>&lt;P&gt;I have in Visual Studio a table `Y2_Sales` which contains a column "`color`" with values like this :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;85-GREY MARLE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;90-BLACK&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;90-BLACK&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1000-WHITE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;49-NAVY&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;90-BLACK&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;3021-BONE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I would like to make a calculated column in my template and delete everything after the dash and put the remaining numbers on 4 characters, which would give :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;0085&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;0090&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;0090&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1000&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;0049&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;0090&lt;/STRONG&gt;&lt;BR /&gt;3021&lt;/P&gt;&lt;P&gt;I tried this formula but it returns me for example `90-` how to remove this last dash?&lt;/P&gt;&lt;P&gt;=LEFT([color],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF (SEARCH("-",[color],1,0) &amp;gt; 0,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEARCH("-",[color],1,0),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEN([color])&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could someone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 15:06:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1826878#M38781</guid>
      <dc:creator>matdub40</dc:creator>
      <dc:date>2021-05-06T15:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete everything after a dash and put the remaining text on 4 characters in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1826981#M38783</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="288382" data-lia-user-login="matdub40" class="lia-mention lia-mention-user"&gt;matdub40&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if you want to do this in Power Query Editor.&lt;/P&gt;&lt;P&gt;I think it is a bit easier doing this in Power Query Editor like below (link down below)&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;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/oxp7d0nks97tort/matdub.pbix?dl=0" target="_self"&gt;https://www.dropbox.com/s/oxp7d0nks97tort/matdub.pbix?dl=0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Linkedin: linkedin.com/in/jihwankim1975/&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Twitter: twitter.com/Jihwan_JHKIM&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 09:07:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1826981#M38783</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-06T09:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete everything after a dash and put the remaining text on 4 characters in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1827011#M38785</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your answer, I will look into it, but I would prefer to do it in Visual Studio with a calculated column without having to modify the Power BI part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have made two distinct columns that separate my two values, I have only one column your two columns separated by a dash like: 90-BLACK&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 09:20:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-delete-everything-after-a-dash-and-put-the-remaining-text/m-p/1827011#M38785</guid>
      <dc:creator>matdub40</dc:creator>
      <dc:date>2021-05-06T09:20:20Z</dc:date>
    </item>
  </channel>
</rss>

