<?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: Measure for Context Based Sales Calculation Not Showing Correct Total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4589741#M175803</link>
    <description>&lt;P&gt;Thanks for your response &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343036" data-lia-user-login="mark_endicott" class="lia-mention lia-mention-user"&gt;mark_endicott&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1227614" data-lia-user-login="weiqb" class="lia-mention lia-mention-user"&gt;weiqb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, creating a disconnected table is the only viable solution in this case. I implemented this approach using a field parameter, and it’s now working fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1227614" data-lia-user-login="weiqb" class="lia-mention lia-mention-user"&gt;weiqb&lt;/a&gt;&amp;nbsp;, ISFILTERED, ISINSCOPE, and ISCROSSFILTERED return the correct total only when the context comes from a single table. However, when the context comes from multiple tables, these functions do not work as expected for total calculations.&lt;BR /&gt;&lt;BR /&gt;Thanks for insights&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2025 09:48:48 GMT</pubDate>
    <dc:creator>vm8181</dc:creator>
    <dc:date>2025-02-28T09:48:48Z</dc:date>
    <item>
      <title>Measure for Context Based Sales Calculation Not Showing Correct Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588169#M175760</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am facing an issue with a dax measure in Power BI that calculates sales based on different attributes from multiple tables. The measure works correctly at the individual row level but does not show the correct total.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Measure i am Using:&lt;/STRONG&gt;&lt;BR /&gt;Sales =&lt;BR /&gt;VAR _values =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;ISINSCOPE(City[city_name]),&amp;nbsp; SUM(City[city_revenue]),&lt;BR /&gt;ISINSCOPE(Keyword[keyword_match_type]), SUM(Keyword[keyword_revenue]),&lt;BR /&gt;ISINSCOPE(Keyword[keyword_name]), SUM(Keyword[keyword_revenue]),&lt;BR /&gt;ISINSCOPE('KW Master'[keyword_type]), SUM(Keyword[keyword_revenue]),&lt;BR /&gt;ISINSCOPE(Placement[page_name]), SUM('Placement'[page_revenue]),&lt;BR /&gt;ISINSCOPE('Product'[product_name]), SUM('Product'[product_revenue]),&lt;BR /&gt;ISINSCOPE('Category'[Category]), SUM('Category'[category_revenue]),&lt;BR /&gt;SUM('Total AdSales'[campaign_revenue])&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;COALESCE(_values, 0)&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Issue is:&lt;/STRONG&gt;&lt;BR /&gt;The measure returns the correct values when breaking down by city, keyword, placement, product, etc.&lt;BR /&gt;However, the total does not reflect the sum of the displayed rows, it seems to follow only the last condition &lt;STRONG&gt;(SUM('Total AdSales'[campaign_revenue]))&lt;/STRONG&gt;. I can't use separate measures for each table because this measure is used in a field parameter, and restructuring the model is not an option.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;What I Need:&lt;/STRONG&gt;&lt;BR /&gt;A way to ensure the total correctly reflects the sum of the displayed context, without affecting the individual breakdowns. Need a solution that works within my existing setup means without creating separate measures for each table.&lt;BR /&gt;&lt;BR /&gt;Any help or suggestions would be greatly appreciated&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 14:31:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588169#M175760</guid>
      <dc:creator>vm8181</dc:creator>
      <dc:date>2025-02-27T14:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for Context Based Sales Calculation Not Showing Correct Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588297#M175767</link>
      <description>&lt;P&gt;You could create a disconnected table containing the different types of table you are showing - City, Keyword match type etc. Add this as a filter to each table visual, selecting just the value applicable to that table.&lt;/P&gt;
&lt;P&gt;Change your measure so that instead of using ISINSCOPE you check the SELECTEDVALUE of the disconnected table column, and then perform the appropriate calculation.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 15:44:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588297#M175767</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-02-27T15:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for Context Based Sales Calculation Not Showing Correct Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588315#M175768</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="665269" data-lia-user-login="vm8181" class="lia-mention lia-mention-user"&gt;vm8181&lt;/a&gt;&amp;nbsp;- You won't be able to acheive this with ISINSCOPE - because that is always FALSE at the total level - without an incredibly horrendous final condition.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Honestly, the best way to acheive this is by modelling your data - I know you say this is not an option, but someone in your organisation can access the model and help you with it. A disconnected table that unions all your appropriate revenues together and then can be used as filter will make this 100 times easier than trying to solve with DAX alone.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 15:52:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588315#M175768</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-02-27T15:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for Context Based Sales Calculation Not Showing Correct Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588329#M175769</link>
      <description>&lt;P&gt;Differences between isinscope/isfiltered/iscrossfiltered, Try ISFILTERED/&lt;SPAN&gt;ISCROSSFILTERED&lt;BR /&gt;Measure:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;City Is &lt;/SPAN&gt;&lt;SPAN&gt;In&lt;/SPAN&gt;&lt;SPAN&gt; Scope =&lt;/SPAN&gt; &lt;SPAN&gt;ISINSCOPE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'city gdp'&lt;/SPAN&gt;&lt;SPAN&gt;[City]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;City Is Filtered =&lt;/SPAN&gt; &lt;SPAN&gt;ISFILTERED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'city gdp'&lt;/SPAN&gt;&lt;SPAN&gt;[City]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;City Is Crossfiltered =&lt;/SPAN&gt; &lt;SPAN&gt;ISCROSSFILTERED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'city gdp'&lt;/SPAN&gt;&lt;SPAN&gt;[City]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 16:00:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4588329#M175769</guid>
      <dc:creator>weiqb</dc:creator>
      <dc:date>2025-02-27T16:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for Context Based Sales Calculation Not Showing Correct Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4589741#M175803</link>
      <description>&lt;P&gt;Thanks for your response &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343036" data-lia-user-login="mark_endicott" class="lia-mention lia-mention-user"&gt;mark_endicott&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1227614" data-lia-user-login="weiqb" class="lia-mention lia-mention-user"&gt;weiqb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, creating a disconnected table is the only viable solution in this case. I implemented this approach using a field parameter, and it’s now working fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1227614" data-lia-user-login="weiqb" class="lia-mention lia-mention-user"&gt;weiqb&lt;/a&gt;&amp;nbsp;, ISFILTERED, ISINSCOPE, and ISCROSSFILTERED return the correct total only when the context comes from a single table. However, when the context comes from multiple tables, these functions do not work as expected for total calculations.&lt;BR /&gt;&lt;BR /&gt;Thanks for insights&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 09:48:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-Context-Based-Sales-Calculation-Not-Showing-Correct/m-p/4589741#M175803</guid>
      <dc:creator>vm8181</dc:creator>
      <dc:date>2025-02-28T09:48:48Z</dc:date>
    </item>
  </channel>
</rss>

