<?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 do I create DAX formula for this accounts hierarchy scenario ? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2563716#M73004</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302339" data-lia-user-login="NipawanV" class="lia-mention lia-mention-user"&gt;NipawanV&lt;/a&gt;&amp;nbsp;hey, can you share with me the sample excel table and write there the logic you need and also add the dsired values manually in a column so I'll be sure what is the result you want and I'll reply with the DAX needed&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 11:26:03 GMT</pubDate>
    <dc:creator>SpartaBI</dc:creator>
    <dc:date>2022-06-07T11:26:03Z</dc:date>
    <item>
      <title>How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554235#M72423</link>
      <description>&lt;P&gt;Hi, I newly user for Power BI, always get stuck with the DAX formula.&amp;nbsp; This is the new requirement that I could not solved for my daily work.&amp;nbsp;&amp;nbsp;&amp;nbsp;I have the requirement to mark thousand of the account records as "TRUE" on &lt;U&gt;Company&lt;/U&gt; and &lt;U&gt;Site&lt;/U&gt; if the &lt;U&gt;Account Level = "Group" and Key Account = "TRUE" as well the Group leve should also "TRUE" in the the condition field&lt;/U&gt;.&amp;nbsp; I don't want to change the existing data from D365 so try to create a new condition column called&amp;nbsp; "KAM" in column F. See my scenario case below on the excel:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&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;I tried to create the column formula "KAM" by using IF, SWITCH condition but couldn't get out the correct result.&amp;nbsp; Showing error messages that I could not solved.&amp;nbsp;&amp;nbsp;Could you as the experts guide me how to build the formula ?&amp;nbsp; Many thanks.&lt;BR /&gt;&lt;BR /&gt;These are my formulas that I got error message and never success.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;1) IF statement&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KAM = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AND&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;[Key Account]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Afry_accountlevel]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Group"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Key Account]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"False"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;[Afry_accountlevel]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPA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gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;[Afry_accountlevel]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Site"&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"False"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Jun 2022 05:41:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554235#M72423</guid>
      <dc:creator>NipawanV</dc:creator>
      <dc:date>2022-06-02T05:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554661#M72446</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302339" data-lia-user-login="NipawanV" class="lia-mention lia-mention-user"&gt;NipawanV&lt;/a&gt;&amp;nbsp;what is the error message you are getting?&lt;BR /&gt;Maybe you need to remove the "" from the true and false?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 07:59:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554661#M72446</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-06-02T07:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554702#M72449</link>
      <description>&lt;P&gt;hi, I tried to remove "" from True / False as well as change ; to , where i make a blue tick.&amp;nbsp; This is the same error that I found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 08:14:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554702#M72449</guid>
      <dc:creator>NipawanV</dc:creator>
      <dc:date>2022-06-02T08:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554790#M72459</link>
      <description>&lt;P&gt;I actually looked at your switch version. Try there.&lt;BR /&gt;In the if version you probably have an extra / missing comma / brackets. Leave it for now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 08:44:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2554790#M72459</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-06-02T08:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2555274#M72513</link>
      <description>&lt;P&gt;Many thanks.&amp;nbsp; Well actually it works but it given the wrong result.&amp;nbsp; Probably I miss one checking condition.&amp;nbsp; I mean KAM field should give True when all the accounts in Company and Site level has the same top parent account (Group).&amp;nbsp; I need to figure out what is the next formula to get the top account first.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 12:10:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2555274#M72513</guid>
      <dc:creator>NipawanV</dc:creator>
      <dc:date>2022-06-02T12:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2555286#M72515</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302339" data-lia-user-login="NipawanV" class="lia-mention lia-mention-user"&gt;NipawanV&lt;/a&gt;&amp;nbsp;my pleasure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;If you don't succeed reply here and mention me and I will help you.&lt;BR /&gt;&lt;BR /&gt;P.S.&lt;BR /&gt;Check out my showcase report:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543" target="_blank"&gt;https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543&lt;/A&gt;&lt;BR /&gt;Give it a thumbs up if you liked it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 12:16:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2555286#M72515</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-06-02T12:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2555414#M72520</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;&amp;nbsp;Many thanks indeed.&amp;nbsp; I will for sure if I get stuck.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 12:44:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2555414#M72520</guid>
      <dc:creator>NipawanV</dc:creator>
      <dc:date>2022-06-02T12:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2563504#M72995</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;&amp;nbsp;Hello, May I get your advice with the formula again.&amp;nbsp; I could not manage to get the correct result with the formula that I created.&amp;nbsp; As you can see from my excel table I need the "KAM" field to be "True" for all Accounts in the hierarchy (3 levels - Group | Compay | Site) by checking this condition =&amp;gt; Account level is "Group" &amp;amp;&amp;amp; Key Account is "True".&amp;nbsp; All child accounts must be "True".&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 09:35:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2563504#M72995</guid>
      <dc:creator>NipawanV</dc:creator>
      <dc:date>2022-06-07T09:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create DAX formula for this accounts hierarchy scenario ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2563716#M73004</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302339" data-lia-user-login="NipawanV" class="lia-mention lia-mention-user"&gt;NipawanV&lt;/a&gt;&amp;nbsp;hey, can you share with me the sample excel table and write there the logic you need and also add the dsired values manually in a column so I'll be sure what is the result you want and I'll reply with the DAX needed&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 11:26:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-create-DAX-formula-for-this-accounts-hierarchy-scenario/m-p/2563716#M73004</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-06-07T11:26:03Z</dc:date>
    </item>
  </channel>
</rss>

