<?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: Trying to get a calculation from 2 different column totals.... in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4231772#M167367</link>
    <description>&lt;P&gt;Thanks Dharmendra- In this case , not quite.&amp;nbsp; the individual site % are correct but the overall "total" % calculation is incorrect and actually way higher-&lt;BR /&gt;&lt;BR /&gt;so for example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My site target GP total calc number is like 400,000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Current Revenue total number is like 2,600,000&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it should calculate about 15% as an example.&amp;nbsp; using what you provided it calculated around 95,000 %&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2024 13:39:41 GMT</pubDate>
    <dc:creator>mikekolba1</dc:creator>
    <dc:date>2024-10-07T13:39:41Z</dc:date>
    <item>
      <title>Trying to get a calculation from 2 different column totals....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4230261#M167297</link>
      <description>&lt;P&gt;I have two columns that are calculating row values&amp;nbsp; correctly with these formulas but the latter &lt;STRONG&gt;Site Target GP&lt;/STRONG&gt; was not calculating the total properly so i had to modify&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Original&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Current Revenue = CALCULATE(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SUM(Query1[Column2]),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FILTER(Query1,SEARCH("Current",Query1[Source.Name],,0)),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FILTER(Query1,Query1[Column1]="Revenue")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Site Target GP = [Current Revenue]*&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;[Target GP Margin %]&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The above was modified to this in order to calcuate the total value correctly, which it does&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Site Target GP TotalCalc = IF(HASONEFILTER(Query1[Site]),[Site Target GP],SUMX(VALUES(Query1[Site]),[Site Target GP]))&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Now I have another calculation i want to do for Site Target GP % based on the "totals" of these 2 calculations&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want to calculate&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Site Target GP% = [Site Target GP]/[Current Revenue]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and individual sites get calculated correctly for this but&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;but for the "Total"of the Site Target GP% calculation I need to do something simliar to what i did with the Site Target GP calculation and override the "total"&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The formula needs to be the value of&amp;nbsp; Total "&lt;STRONG&gt;Current Reveue&lt;/STRONG&gt;" (of all sites) which totals correctly for all sites with the first formula and the default power BI summation&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;divided by&lt;/STRONG&gt;&amp;nbsp; the total value I'm obtaining via&amp;nbsp;&lt;STRONG&gt; Site Target GP TotalCalc = IF(HASONEFILTER(Query1[Site]),[Site Target GP],SUMX(VALUES(Query1[Site]),[Site Target GP]))&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How's the best way to achieve this? These are all "measures' also.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 05 Oct 2024 23:35:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4230261#M167297</guid>
      <dc:creator>mikekolba1</dc:creator>
      <dc:date>2024-10-05T23:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a calculation from 2 different column totals....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4230277#M167300</link>
      <description>&lt;P&gt;some example data to illustrate&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;site&lt;/TD&gt;&lt;TD&gt;Current Revenue&lt;/TD&gt;&lt;TD&gt;Site Target GP&lt;/TD&gt;&lt;TD&gt;Site Target GP TotalCalc&lt;/TD&gt;&lt;TD&gt;Site Target GP%&lt;/TD&gt;&lt;TD&gt;Site Target GP% TotalCalc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;55&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;d&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;185&lt;/TD&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;X&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Trying to get the (X) calculated value from the 185/6&amp;nbsp; (30.333)&amp;nbsp; using the measure information above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2024 00:07:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4230277#M167300</guid>
      <dc:creator>mikekolba1</dc:creator>
      <dc:date>2024-10-06T00:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a calculation from 2 different column totals....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4230825#M167334</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="101828" data-lia-user-login="mikekolba1" class="lia-mention lia-mention-user"&gt;mikekolba1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate the overall total (denoted as "X" in your example), you need to do a weighted average calculation using Current Revenue as the weight.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of directly summing up the percentages, you can use this formula to calculate the total Site Target GP % based on the weighted average&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SiteTargetGP_TotalCalc =&lt;BR /&gt;IF(&lt;BR /&gt;HASONEFILTER(Query1[Site]),[Site Target GP %], -- Use the individual site value&lt;BR /&gt;DIVIDE(&lt;BR /&gt;SUMX(VALUES(Query1[Site]), [Site Target GP] * [Current Revenue]),&lt;/P&gt;&lt;P&gt;SUMX(VALUES(Query1[Site]), [Current Revenue])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; are much appreciated!&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Dharmendar S&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.linkedin.com/in/dharmendar-s-b5b43463/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;LinkedIN&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&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;</description>
      <pubDate>Sun, 06 Oct 2024 18:57:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4230825#M167334</guid>
      <dc:creator>dharmendars007</dc:creator>
      <dc:date>2024-10-06T18:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a calculation from 2 different column totals....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4231772#M167367</link>
      <description>&lt;P&gt;Thanks Dharmendra- In this case , not quite.&amp;nbsp; the individual site % are correct but the overall "total" % calculation is incorrect and actually way higher-&lt;BR /&gt;&lt;BR /&gt;so for example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My site target GP total calc number is like 400,000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Current Revenue total number is like 2,600,000&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it should calculate about 15% as an example.&amp;nbsp; using what you provided it calculated around 95,000 %&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 13:39:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4231772#M167367</guid>
      <dc:creator>mikekolba1</dc:creator>
      <dc:date>2024-10-07T13:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a calculation from 2 different column totals....</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4231947#M167374</link>
      <description>&lt;P&gt;Doing this though got me the answer i needed so giving you credit as it led me to it&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;SiteTargetGP_TotalCalc =&lt;BR /&gt;IF(&lt;BR /&gt;HASONEFILTER(Query1[Site]),[Site Target GP %], -- Use the individual site value&lt;BR /&gt;DIVIDE(&lt;BR /&gt;SUMX(VALUES(Query1[Site]), [Site Target GP]),&lt;/P&gt;&lt;P&gt;SUMX(VALUES(Query1[Site]), [Current Revenue])))&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 14:57:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-calculation-from-2-different-column-totals/m-p/4231947#M167374</guid>
      <dc:creator>mikekolba1</dc:creator>
      <dc:date>2024-10-07T14:57:33Z</dc:date>
    </item>
  </channel>
</rss>

