<?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 get the Number of Characters from a Column with a certain condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3519205#M135165</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="637433" data-lia-user-login="juhoneyighot" class="lia-mention lia-mention-user"&gt;juhoneyighot&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can try to use following formula to create a calculated column to get the character counts:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;charCount =
VAR _path =
    SUBSTITUTE ( 'Table'[Text], "_", "|" )
VAR _suffix =
    PATHITEM ( _path, PATHLENGTH ( _path ) )
VAR replaced =
    SUBSTITUTE ( 'Table'[Text], "_" &amp;amp; _suffix, "" )
RETURN
    LEN ( replaced )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2023 07:20:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-11-07T07:20:53Z</dc:date>
    <item>
      <title>How to get the Number of Characters from a Column with a certain condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3515668#M134961</link>
      <description>&lt;P&gt;Hello! I am new to PowerBI.&lt;/P&gt;&lt;P&gt;I need to have a calculated column how to get the number of characters from a certain column(JobType_txt).&amp;nbsp;However, there is one condition. Some of the Jobtype_txt dont have a value in # of _ Column. See screenshot below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition is: If # of _ is " " then Phase_=" " else need a calculation for below requirement.&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;Example: Jobtype_txt: NC 110_Estimates__10NotStarted&lt;/P&gt;&lt;P&gt;The text is divided into&lt;/P&gt;&lt;P&gt;Prefix: NC 110&lt;/P&gt;&lt;P&gt;"_"&lt;/P&gt;&lt;P&gt;Phase_:Estimates_&lt;/P&gt;&lt;P&gt;"_",&lt;/P&gt;&lt;P&gt;Status:10NtotStarted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I need to have a calculated column the number of characters from Prefix until "Phase_". So from JobType_text: &lt;STRONG&gt;NC&lt;/STRONG&gt; &lt;STRONG&gt;110_Estimates_&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the Phase_=17&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this sample Excel formula for this. See screenshot below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is I don't know how to convert this to DAX formula.&lt;/P&gt;&lt;P&gt;I hope you can help me on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 12:10:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3515668#M134961</guid>
      <dc:creator>juhoneyighot</dc:creator>
      <dc:date>2023-11-04T12:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Number of Characters from a Column with a certain condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3516413#M134997</link>
      <description>&lt;P&gt;Does it have to be DAX? You can use the PATH functions for that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's much easier to do in Power Query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data &lt;STRONG&gt;that fully covers your issue&lt;/STRONG&gt;. Are there two underscores as the second divider?&lt;BR /&gt;Please show the expected outcome based on the sample data you provided.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2023 13:59:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3516413#M134997</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-11-05T13:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Number of Characters from a Column with a certain condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3519205#M135165</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="637433" data-lia-user-login="juhoneyighot" class="lia-mention lia-mention-user"&gt;juhoneyighot&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can try to use following formula to create a calculated column to get the character counts:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;charCount =
VAR _path =
    SUBSTITUTE ( 'Table'[Text], "_", "|" )
VAR _suffix =
    PATHITEM ( _path, PATHLENGTH ( _path ) )
VAR replaced =
    SUBSTITUTE ( 'Table'[Text], "_" &amp;amp; _suffix, "" )
RETURN
    LEN ( replaced )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 07:20:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-Number-of-Characters-from-a-Column-with-a-certain/m-p/3519205#M135165</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-07T07:20:53Z</dc:date>
    </item>
  </channel>
</rss>

