<?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 Division Based on Condition/Filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3936638#M153097</link>
    <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;I am using the current formula in a measure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Annual Impacted True ROI = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ( [Monthly Profit Difference (excess)] * &lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &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; ( 'Dev projects'[Total Cost] ), 'All Actual Data'[Store Impacted])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; StoreList[StoreNumber]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I am trying to do is divide by the total cost for the Store Impacted hence the calculate filter by [Store Impacted]. I do not want to divide by the [Total Cost] for a specific Store, I want to divide the profit by the store being impacted [Total Cost]. The Store Impacted column is a calculated column in the 'All Actual Data' table which is a lookupvalue formula pulling the actual column from the 'ROI_Impact_Stores' table. An unnecessary step as their is a relationship between the two tables, just providing more context.&lt;BR /&gt;&lt;BR /&gt;For example, in the image above, I want to divide the&amp;nbsp;monthly profit excess measure by the cost for the test store, 13348 (this is the Store Impacted) for each control store and the test store.&lt;BR /&gt;So monthly profit for 13268 / cost for store 13348.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you in advance!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 21 May 2024 16:36:27 GMT</pubDate>
    <dc:creator>james_pease</dc:creator>
    <dc:date>2024-05-21T16:36:27Z</dc:date>
    <item>
      <title>Division Based on Condition/Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3936638#M153097</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;I am using the current formula in a measure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Annual Impacted True ROI = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ( [Monthly Profit Difference (excess)] * &lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &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; ( 'Dev projects'[Total Cost] ), 'All Actual Data'[Store Impacted])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; StoreList[StoreNumber]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I am trying to do is divide by the total cost for the Store Impacted hence the calculate filter by [Store Impacted]. I do not want to divide by the [Total Cost] for a specific Store, I want to divide the profit by the store being impacted [Total Cost]. The Store Impacted column is a calculated column in the 'All Actual Data' table which is a lookupvalue formula pulling the actual column from the 'ROI_Impact_Stores' table. An unnecessary step as their is a relationship between the two tables, just providing more context.&lt;BR /&gt;&lt;BR /&gt;For example, in the image above, I want to divide the&amp;nbsp;monthly profit excess measure by the cost for the test store, 13348 (this is the Store Impacted) for each control store and the test store.&lt;BR /&gt;So monthly profit for 13268 / cost for store 13348.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you in advance!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 May 2024 16:36:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3936638#M153097</guid>
      <dc:creator>james_pease</dc:creator>
      <dc:date>2024-05-21T16:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Division Based on Condition/Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3937411#M153122</link>
      <description>&lt;P&gt;You are supplying filter conditions that always evaluate to true. Modify your filters so the actually have an effect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The outer CALCULATE is likely not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&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;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &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;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&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>Wed, 22 May 2024 01:02:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3937411#M153122</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-05-22T01:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Division Based on Condition/Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3940237#M153201</link>
      <description>&lt;P&gt;Thank you! This helped me come up with an alternative solution. I created a lookupvalue column (just so I can visually see):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;Total Cost Store Impacted =&lt;/SPAN&gt; &lt;SPAN&gt;LOOKUPVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Dev projects'&lt;/SPAN&gt;&lt;SPAN&gt;[Total Cost]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Dev projects'&lt;/SPAN&gt;&lt;SPAN&gt;[Store]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ROI_Impact_Stores&lt;/SPAN&gt;&lt;SPAN&gt;[Store Impacted]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Then I adjusted the formula for the annual true ROI measure:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;Annual Impacted True ROI = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ( [Monthly Profit Difference (excess)] * &lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt; ), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&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;('ROI_Impact_Stores'[Total Cost Store Impacted]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class="lia-indent-padding-left-30px"&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 15:29:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3940237#M153201</guid>
      <dc:creator>james_pease</dc:creator>
      <dc:date>2024-05-22T15:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Division Based on Condition/Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3940297#M153203</link>
      <description>&lt;P&gt;Ok, now find a solution that does not use LOOKUPVALUE...&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 15:56:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-Based-on-Condition-Filter/m-p/3940297#M153203</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-05-22T15:56:06Z</dc:date>
    </item>
  </channel>
</rss>

