<?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: Incorrect results for Divide function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4371096#M173526</link>
    <description>&lt;P&gt;Thanks for the replies from&amp;nbsp;lbendlin and&amp;nbsp;rmateo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="840685" data-lia-user-login="mwebergo2" class="lia-mention lia-mention-user"&gt;mwebergo2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you solved your problem? If it is solved, please share your solution and accept it as solution or mark the helpful replies, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&amp;nbsp;Thank you very much for your kind cooperation!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Best Regards,&lt;BR /&gt;Zhu&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 05:25:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-20T05:25:54Z</dc:date>
    <item>
      <title>Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355811#M172931</link>
      <description>&lt;P&gt;I've seen numerous posts on this topic that all seem to indicate the need for a measure instead of calculated column.&amp;nbsp; I am using measures but still getting incorrect results.&amp;nbsp; I am trying to dive the sum of Annual Expense by the sum of Book Value to get a ratio of expense to assets under management.&amp;nbsp;&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 seems so simple, but I am not getting correct results.&amp;nbsp; The DAX formula I am using is as follows:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Expense Ratio = &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('2025 Baseline Forecast'[Annual Expense])), &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('Last Month Positions'[Book Value])),&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355811#M172931</guid>
      <dc:creator>mwebergo2</dc:creator>
      <dc:date>2025-01-08T20:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355905#M172935</link>
      <description>&lt;P&gt;Do you display that measure next to a column from the Calendar Table?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 21:59:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355905#M172935</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-08T21:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355909#M172936</link>
      <description>&lt;P&gt;No&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 22:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355909#M172936</guid>
      <dc:creator>mwebergo2</dc:creator>
      <dc:date>2025-01-08T22:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355916#M172937</link>
      <description>&lt;P&gt;Here's a snip of the dashboard.&amp;nbsp; The expense ratio card (circled in blue) is the measure I am trying to depict.&amp;nbsp; It is the results of dividing the two cards just above it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 22:11:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355916#M172937</guid>
      <dc:creator>mwebergo2</dc:creator>
      <dc:date>2025-01-08T22:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355992#M172941</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 00:22:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4355992#M172941</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-09T00:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4356116#M172948</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Verify Relationships&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ensure there's a valid relationship between '2025 Baseline Forecast' and 'Last Month Positions'.&lt;/LI&gt;&lt;LI&gt;If these tables are not directly related, the SUM calculations might not be in the same filter context.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Test Individual Components&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create separate measures to confirm each component is returning expected results:&lt;DIV class=""&gt;&lt;DIV class=""&gt;DAX&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Copy code&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;TotalExpense = SUM('2025 Baseline Forecast'[Annual Expense]) TotalBookValue = SUM('Last Month Positions'[Book Value])&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;Use these measures in a table visual alongside your dimensions to ensure they calculate correctly.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Validate Filter Context&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If your data uses different dimensions (e.g., time, region, category), ensure both tables are being filtered correctly by the same dimensions.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Row-Level Aggregation Check&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ensure the calculation doesn’t suffer from granularity mismatch. For example, if Book Value is stored at a more granular level (e.g., daily) than Annual Expense (e.g., yearly), aggregations might not align correctly.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;Adjusted Formula:&lt;/H3&gt;&lt;P&gt;If your data model has no issues and you simply need the correct context for the division:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;DAX:&lt;/DIV&gt;&lt;DIV class=""&gt;Expense Ratio = DIVIDE( CALCULATE(SUM('2025 Baseline Forecast'[Annual Expense])), CALCULATE(SUM('Last Month Positions'[Book Value])), 0 )&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;Additional Scenarios:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;If Tables Are Not Related&lt;/STRONG&gt;: Use CROSSFILTER or ALL to manipulate filter context:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;DAX&lt;/DIV&gt;&lt;DIV class=""&gt;Expense Ratio = DIVIDE( CALCULATE(SUM('2025 Baseline Forecast'[Annual Expense]), ALL('Last Month Positions')), CALCULATE(SUM('Last Month Positions'[Book Value]), ALL('2025 Baseline Forecast')), 0 )&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;If You Need a Weighted Average&lt;/STRONG&gt;: Use a more complex formula to handle weighting:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;DAX&lt;/DIV&gt;&lt;DIV class=""&gt;Expense Ratio = DIVIDE( SUMX( 'YourCommonDimensionTable', CALCULATE(SUM('2025 Baseline Forecast'[Annual Expense])) ), SUMX( 'YourCommonDimensionTable', CALCULATE(SUM('Last Month Positions'[Book Value])) ), 0 )&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Visual Troubleshooting:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Add the Expense Ratio measure to a matrix visual with relevant dimension columns (e.g., year, category) to confirm results at different levels of granularity.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If the issue persists, share details about the data relationships, granularity, or any specific filters that may affect calculations.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Jan 2025 02:32:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4356116#M172948</guid>
      <dc:creator>rmateo</dc:creator>
      <dc:date>2025-01-09T02:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results for Divide function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4371096#M173526</link>
      <description>&lt;P&gt;Thanks for the replies from&amp;nbsp;lbendlin and&amp;nbsp;rmateo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="840685" data-lia-user-login="mwebergo2" class="lia-mention lia-mention-user"&gt;mwebergo2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you solved your problem? If it is solved, please share your solution and accept it as solution or mark the helpful replies, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&amp;nbsp;Thank you very much for your kind cooperation!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Best Regards,&lt;BR /&gt;Zhu&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 05:25:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Incorrect-results-for-Divide-function/m-p/4371096#M173526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-20T05:25:54Z</dc:date>
    </item>
  </channel>
</rss>

