<?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: PATH function extract sub-level 2 hierarchy in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1615360#M32529</link>
    <description>&lt;P&gt;Wow, many thanks again &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="264353" data-lia-user-login="wdx223_Daniel" class="lia-mention lia-mention-user"&gt;wdx223_Daniel&lt;/a&gt;. This works! I have learned much from your clear and elegant solutions.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 23:20:42 GMT</pubDate>
    <dc:creator>witbi</dc:creator>
    <dc:date>2021-01-21T23:20:42Z</dc:date>
    <item>
      <title>PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1609434#M32326</link>
      <description>&lt;P&gt;I'm trying to use PATH functions to generate a flat table for filtering.&amp;nbsp;Examples online seem to start with an explicit hierarchy in the table. I'm stuck on extracting the sub-level 2 hierarchy from my data (see below). Am starting out with Power BI so if anyone can provide some guidance that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:06:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1609434#M32326</guid>
      <dc:creator>witbi</dc:creator>
      <dc:date>2021-01-19T20:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1609892#M32348</link>
      <description>&lt;P&gt;LOOKUPVALUE is most likely not what you want.&amp;nbsp;Please provide sample data in usable format (not a picture) and show the expected outcome.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 02:04:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1609892#M32348</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-01-20T02:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1610272#M32359</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270611" data-lia-user-login="witbi" class="lia-mention lia-mention-user"&gt;witbi&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Are you looking for this?&lt;BR /&gt;Yes, try this. For this, you need to add the index column.&lt;BR /&gt;You can easily add the index column in the power query editor.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 06:00:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1610272#M32359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-20T06:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1611939#M32408</link>
      <description>&lt;P&gt;Yes&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;an Index makes sense&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:54:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1611939#M32408</guid>
      <dc:creator>witbi</dc:creator>
      <dc:date>2021-01-20T17:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1612046#M32409</link>
      <description>&lt;P&gt;Hi Ibendlin,&lt;/P&gt;&lt;P&gt;Column 1-4 is the initial table. As Anonymous&lt;/a&gt;&amp;nbsp; pointed out I was missing the index.&lt;BR /&gt;&lt;BR /&gt;"Expected Hierarchy"&amp;nbsp;is what I am looking to calculate so I can run PATH functions like this to calculate Level 1, Level 2, Level for use in a slicer:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Level 1= LOOKUPVALUE(Expected_result[Description],Expected_result[Index], PATHITEM(Expected_result[Path],1,1))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I've tried to calculate the column "Calculated Hierarchy" to resemble the "Expected Hierarchy" but it has become overly complicated.&amp;nbsp;I would appreciate any ideas on creating a calculated column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculated Hierarchy = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _l1=IF(LEN(Expected_result_test[Ref])=Expected_result_test[Pathlength],Expected_result_test[Index])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _delimiter1=SUBSTITUTE(Expected_result_test[Ref],".","|",1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _l2_len=SEARCH("|",_delimiter1,,LEN(_delimiter1))-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _parent=LEFT(_delimiter1,_l2_len)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _index= IF(ISERROR(LOOKUPVALUE(Expected_result_test[Index],Expected_result_test[Ref],_parent)),"",LOOKUPVALUE(Expected_result_test[Index],Expected_result_test[Ref],_parent))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _path=&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ISBLANK(_l1),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CONCATENATE(_index,CONCATENATE("|",Expected_result_test[Index])),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_l1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_path&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Sample data:&lt;BR /&gt;&lt;BR /&gt;Ref,Description,Event,Index,Expected Hierarchy,Level 1,Level 2,Level 3,Calculated Hierarchy&lt;BR /&gt;1,Andy,A,1,1,Andy,,,1&lt;BR /&gt;1.1,Green,A,2,1|2,Andy,Green,,|1&lt;BR /&gt;1.2,Blue,A,3,1|3,Andy,Blue,,|3&lt;BR /&gt;1.2.1,Water,A,4,1|3|4,Andy,Blue,Water,|4&lt;BR /&gt;2,Bill,A,5,5,Bill,,,5&lt;BR /&gt;2.1,Yellow,A,6,5|6,Bill,Yellow,,5|6&lt;BR /&gt;2.1.1,Wood,A,7,5|6|7,Bill,Yellow,Wood,5|7&lt;BR /&gt;2.1.2,Paper,A,8,5|6|8,Bill,Yellow,Paper,5|8&lt;BR /&gt;2.2,Orange,A,9,5|9,Bill,Orange,,5|9&lt;BR /&gt;3,Chris,B,10,10,Chris,,,10&lt;BR /&gt;3.1,Purple,B,11,10|11,Chris,Purple,,|11&lt;BR /&gt;4,Dave,B,12,12,Dave,,,12&lt;BR /&gt;4.1,Black,B,13,12|13,Dave,Black,,12|13&lt;BR /&gt;4.2,White,B,14,12|14,Dave,White,,12|14&lt;BR /&gt;1,Andy,C,15,1,Andy,,,15&lt;BR /&gt;1.2,Blue,C,16,1|3,Andy,Blue,,|16&lt;BR /&gt;1.2.1,Water,C,17,1|3|4,Andy,Blue,Water,|17&lt;BR /&gt;3,Chris,C,18,10,Chris,,,18&lt;BR /&gt;3.1,Purple,C,19,10|11,Chris,Purple,,19&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:32:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1612046#M32409</guid>
      <dc:creator>witbi</dc:creator>
      <dc:date>2021-01-20T18:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1612536#M32424</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270611" data-lia-user-login="witbi" class="lia-mention lia-mention-user"&gt;witbi&lt;/a&gt;&amp;nbsp;here is the formula for your reference&lt;/P&gt;
&lt;P&gt;you just need to change the number which the arrow points.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 00:29:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1612536#M32424</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2021-01-21T00:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: PATH function extract sub-level 2 hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1615360#M32529</link>
      <description>&lt;P&gt;Wow, many thanks again &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="264353" data-lia-user-login="wdx223_Daniel" class="lia-mention lia-mention-user"&gt;wdx223_Daniel&lt;/a&gt;. This works! I have learned much from your clear and elegant solutions.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 23:20:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PATH-function-extract-sub-level-2-hierarchy/m-p/1615360#M32529</guid>
      <dc:creator>witbi</dc:creator>
      <dc:date>2021-01-21T23:20:42Z</dc:date>
    </item>
  </channel>
</rss>

