<?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: Allocation percentage of margin in different office in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4398857#M174665</link>
    <description>&lt;P&gt;Sahir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you had a chance to look at my reply underneath? It's really urgent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2025 20:43:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-02-06T20:43:04Z</dc:date>
    <item>
      <title>Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4394526#M174469</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm dealing with a special situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a Fact table BrutoMargin (Margin) where we have our margin numbers. The margin number has an office key that indicates where the margin is located. But there is one exception, when the margin deals with a number that has to do with an international worker, that's when 75% of the margin number needs to be allocated to the "International Office Key".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the datamodel situation right now, there are many relationships but the most important one is the relationship with the dimension table "Office":&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to be clear this is a simplified version of what one row in the fact margin table would look like:&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;Office key -12 = Office local 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; International office key -20 = International Office 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The office key is joined with the dimension table "Office". I haven't done anything with "International office key" yet, but the key belongs to the same dimension table "office" to reference it's value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how do I dynamically allocate 25% of the total margin number (625 euro) to the normal office (office key) ) and 75% (1875 euro) tot the "International office" (international office key), so that I can show this in a matrix table in Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're using a simple Matrix table in Power BI to visualize the margin with the office and next to it the Margin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I would like to see is this in a Matrix table Power BI:&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;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 14:26:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4394526#M174469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-04T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4395396#M174508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please try the following dax:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Adjusted Margin =
SUMX (
    BrutoMargin,
    VAR CurrentOfficeKey = SELECTEDVALUE ( Office[Office Key] )
    VAR IntlOfficeKey = BrutoMargin[International Office Key]
    VAR MarginValue = BrutoMargin[Margin]
    RETURN
        IF (
            NOT ISBLANK ( IntlOfficeKey ),
            SWITCH (
                TRUE (),
                CurrentOfficeKey = BrutoMargin[Office Key], MarginValue * 0.25,
                CurrentOfficeKey = IntlOfficeKey, MarginValue * 0.75,
                0
            ),
            IF ( CurrentOfficeKey = BrutoMargin[Office Key], MarginValue, 0 )
        )
)&lt;/LI-CODE&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;If the problem persists, please provide sample data&amp;nbsp;that fully covers your issue (in the form of table or pbix file) and the expected outcome based on the sample data you provided. Please remove any sensitive data in advance.&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;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jayleny&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 03:47:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4395396#M174508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-05T03:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396177#M174537</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you perhaps please try creating a DAX measure for the allocated margin:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Allocated Margin = 
VAR NormalOfficeKey = SELECTEDVALUE('Fact BrutoMarge'[Office_Key])
VAR InternationalOfficeKey = SELECTEDVALUE('Fact BrutoMarge'[International Office Key])
VAR TotalMargin = SUM('Fact BrutoMarge'[Margin])

RETURN 
    SWITCH(
        TRUE(),
        NormalOfficeKey &amp;lt;&amp;gt; BLANK(), TotalMargin * 0.25,
        InternationalOfficeKey &amp;lt;&amp;gt; BLANK(), TotalMargin * 0.75,
        BLANK()
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 Feb 2025 10:42:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396177#M174537</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-02-05T10:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396325#M174545</link>
      <description>&lt;P&gt;Hi Sahir&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the quick response!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to connect the "International office key" in a relationship to the Dimension table "Dim Office" before I try this measure?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 12:18:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396325#M174545</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-05T12:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396327#M174546</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Jayleny&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, I'm gonna give this a try as soon as possible and I will get back to you if I need more help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question though,&amp;nbsp;&lt;SPAN&gt;do I need to connect the "International office key" in a relationship to the Dimension table "Dim Office" before I try this measure?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 12:19:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396327#M174546</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-05T12:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396566#M174555</link>
      <description>&lt;P&gt;Hi Sahir&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's start again cause I forgot a few things&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt; (the percentage allocation can also go the other way around and is a variable column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll give you all the info using a dummy table (one you can replicate in BI) and the result I want.&lt;/P&gt;&lt;P&gt;I've made a dummy table that looks like this:&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;Which gives me this result when I simply calculate the total margin (this is without the allocation stuff):&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;This is the result with your measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But this is the result I want (I hardcoded this to get the result):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;(office key -110) ANTN = total of &lt;STRONG&gt;500&lt;/STRONG&gt; (25% of 2000 = 500)&lt;/LI&gt;&lt;LI&gt;(office key -105) GENT = total of &lt;STRONG&gt;2000&lt;/STRONG&gt; (100% of 250 + 25% of 3000 + 25% of 4000)&lt;/LI&gt;&lt;LI&gt;(office key -36) IDM = total of &lt;STRONG&gt;6750&lt;/STRONG&gt; (75% of 2000 + 75% of 3000 + 75% of 4000)&lt;/LI&gt;&lt;/UL&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;How do I do this?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 14:49:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396566#M174555</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-05T14:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396597#M174556</link>
      <description>&lt;P&gt;Hi Jayleny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's start again cause I forgot a few things!&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(the percentage allocation can also go the other way around and is a variable column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll give you all the info using a dummy table (one you can replicate in BI) and the result I want.&lt;/P&gt;&lt;P&gt;I've made a dummy table that looks like this:&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;Which gives me this result when I simply calculate the total margin (this is without the allocation stuff):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is the result with your measure:&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;But this is the result I want (I hardcoded this to get the result):&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;UL&gt;&lt;LI&gt;(office key -110) ANTN = total of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;500&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(25% of 2000 = 500)&lt;/LI&gt;&lt;LI&gt;(office key -105) GENT = total of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2000&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(100% of 250 + 25% of 3000 + 25% of 4000)&lt;/LI&gt;&lt;LI&gt;(office key -36) IDM = total of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;6750&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(75% of 2000 + 75% of 3000 + 75% of 4000)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;How do I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 11:27:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4396597#M174556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-07T11:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4398857#M174665</link>
      <description>&lt;P&gt;Sahir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you had a chance to look at my reply underneath? It's really urgent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 20:43:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4398857#M174665</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-06T20:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation percentage of margin in different office</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4399954#M174687</link>
      <description>&lt;P&gt;Hi Jayleny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you had a chance to look at my reply underneath? It's really urgent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 11:28:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Allocation-percentage-of-margin-in-different-office/m-p/4399954#M174687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-07T11:28:06Z</dc:date>
    </item>
  </channel>
</rss>

