<?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: DIVIDE two tables measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101774#M109078</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="457718" data-lia-user-login="arquironsalud" class="lia-mention lia-mention-user"&gt;arquironsalud&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;What is the DAX fro both SALES and COSTS?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 15:14:39 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-02-27T15:14:39Z</dc:date>
    <item>
      <title>DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101070#M109021</link>
      <description>&lt;P&gt;I turn to the wisdom of this forum because I have a question that I can not solve and I'm going crazy. I am going to describe the structure of my data and then I will explain the problem I have. If you need any clarification, do not hesitate to let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables:&lt;BR /&gt;-The first one is called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;ACCOUNTS&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and contains the following columns: "15 DIG" (text), "1 DIG" (text) "AGGREGATOR RATIOS" (text)&amp;nbsp;&lt;BR /&gt;-The second one is called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;BALANCES&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and contains the following columns: "COD ACCOUNT 1" (text), "ACCOUNT 15" (text) and "IMPORT" (currency).&lt;BR /&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;relationship between both tables is ACCOUNTS[15 DIG] with BALANCES[ACCOUNT 15]&lt;/U&gt;. I show an explanatory image below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In addition, I have created two measures.&lt;BR /&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;measure COSTS&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is the sum of BALANCES[IMPORT] when BALANCES[COD ACCOUNT 1]="6".&amp;nbsp;If we consider the above BALANCE table as an example, COSTS would be 9260 (coming from 160+4100+5000).&lt;BR /&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;measure SALES&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is the summation of BALANCES[AMOUNTS] when BALANCES[CODE ACCOUNT 1]="7".&amp;nbsp;If we consider the above BALANCE table as an example, COSTS would be 80.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a visual object of type matrix that shows the following:&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;And finally we come to my problem, which is none other than the "PESO" measurement that you see in the image. I need this measure to return COSTS/SALES for each AGGREGATOR RATIOS, where SALES is always the same number, and COSTS varies according to the AGGREGATOR RATIOS (which can be APROVISIONAMIENTO, FARMACIA, MAT. SANITARIO, etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example of the result of the previous image, the PESO for APROVISIONAMIENTOS should be 20.16% (comes from 34319945 / 170162096), 10.49% for SUBCONTRATACIONES (comes from 17856677 / 170162096).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, I need you to tell me the DAX of PESO, since I always get 0, and I don't know why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 10:14:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101070#M109021</guid>
      <dc:creator>arquironsalud</dc:creator>
      <dc:date>2023-02-27T10:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101352#M109032</link>
      <description>&lt;P&gt;The problem is your data model in my opinion. You use "1 DIG" for the relationship and also as a filter criteria in your DAX formula. You need a relationship via the "&lt;SPAN&gt;AGGREGATOR RATIOS". Than you are able to calculated for each RATIOS the correct Costs and sales. Perhaps you have to transform your data. Perhaps some sample data will help to understand the data structure.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 12:13:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101352#M109032</guid>
      <dc:creator>andhiii079845</dc:creator>
      <dc:date>2023-02-27T12:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101363#M109033</link>
      <description>&lt;P&gt;Hi, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;relationship between both tables is ACCOUNTS[15 DIG] with BALANCES[ACCOUNT 15]&lt;/U&gt;&lt;SPAN&gt;, not "1 DIG". Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 12:17:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101363#M109033</guid>
      <dc:creator>arquironsalud</dc:creator>
      <dc:date>2023-02-27T12:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101403#M109038</link>
      <description>&lt;P&gt;My fault sorry! But in your matrix you use "1 DIG" as a column. Can you remove it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 12:33:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101403#M109038</guid>
      <dc:creator>andhiii079845</dc:creator>
      <dc:date>2023-02-27T12:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101498#M109048</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="457718" data-lia-user-login="arquironsalud" class="lia-mention lia-mention-user"&gt;arquironsalud&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;PESO =&lt;BR /&gt;DIVIDE ( [COSTS], CALCULATE ( [SALES], REMOVEFILTERS () ) )&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 13:24:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101498#M109048</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-27T13:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101638#M109066</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It has changed somewhat, at least it is no longer all zeros, but the percentages are wrong. In the case of OTROS COSTES if we do the operation 9169273 / 170162096, the result should be 5.38% not 0.35%.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 14:27:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101638#M109066</guid>
      <dc:creator>arquironsalud</dc:creator>
      <dc:date>2023-02-27T14:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101774#M109078</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="457718" data-lia-user-login="arquironsalud" class="lia-mention lia-mention-user"&gt;arquironsalud&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;What is the DAX fro both SALES and COSTS?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 15:14:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101774#M109078</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-27T15:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: DIVIDE two tables measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101941#M109100</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Thanks for your point, it has led me to find a solution. There is a slight difference. The formula that worked for me was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PESO =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DIVIDE ( [COSTS], CALCULATE ( [SALES], ALLSELECTED () ) )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 16:04:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DIVIDE-two-tables-measure/m-p/3101941#M109100</guid>
      <dc:creator>arquironsalud</dc:creator>
      <dc:date>2023-02-27T16:04:24Z</dc:date>
    </item>
  </channel>
</rss>

