<?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: Issue with Aggregating Measures Using SELECTEDVALUE() in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4646769#M177866</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1244016" target="_blank"&gt;@VT_KMS&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;&lt;SPAN&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Apr 2025 11:36:19 GMT</pubDate>
    <dc:creator>v-hashadapu</dc:creator>
    <dc:date>2025-04-10T11:36:19Z</dc:date>
    <item>
      <title>Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4621316#M176882</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi all,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am having an issue with using SELECTEDVALUE(). I created a measure with SELECTEDVALUE() to calculate revenue change at the product level.&lt;/P&gt;&lt;P&gt;However, when I try to aggregate that value to the month level, it doesn't work if PRODUCTKEY is not present in the visual.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Expected value should be -15,828.&lt;/P&gt;&lt;P&gt;Here are my dax measure:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;revenue_change_product&lt;/STRONG&gt; = &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var __category = SELECTEDVALUE(ARRDATA_CUSTOMER_PRODUCT[CATEGORY_PRODUCT])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var __curAmount = SUM(ARRDATA_CUSTOMER_PRODUCT[ARR_AMOUNT])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;SWITCH(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;TRUE(),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;__category = "CROSS-SELLPRODUCT1", __curAmount - [PRE_CROSS-SELL1],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;__category = "LOST-PRODUCTPRODUCT1", __curAmount - [PRE_LOST_PRODUCT1],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;__category = "PRODUCT REACTIVATIONPRODUCT1", __curAmount - [PRE_REACT_PRODUCT1]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;sum_updownsell_product&lt;/STRONG&gt; = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SUMX(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (customer_product_measure),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECTEDVALUE(customer_product_measure[MONTH])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; ,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; [revenue_change_product]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I properly aggregate this measure to the month level even when PRODUCTKEY is not in the visual? Any suggestions would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 15:30:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4621316#M176882</guid>
      <dc:creator>VT_KMS</dc:creator>
      <dc:date>2025-03-23T15:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4623087#M176958</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>Mon, 24 Mar 2025 22:32:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4623087#M176958</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-24T22:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4630266#M177256</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1244016" data-lia-user-login="VT_KMS" class="lia-mention lia-mention-user"&gt;VT_KMS&lt;/a&gt;&amp;nbsp;, Thank you for reaching out to the Microsoft Community Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have two methods to do this:&lt;BR /&gt;By using CALCULATE, you modify the filter context to ignore the product-level details while keeping the month-level context intact. SUMX then iterates over all products and sums the revenue changes correctly. This is the most efficient and robust solution, especially for larger datasets.&lt;/P&gt;
&lt;P&gt;sum_updownsell_product =&lt;/P&gt;
&lt;P&gt;CALCULATE(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUMX(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALL(ARRDATA_CUSTOMER_PRODUCT),&amp;nbsp; -- Removes product-level filters&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [revenue_change_product]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUES(ARRDATA_CUSTOMER_PRODUCT[MONTH]) -- Keeps the month-level filter&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second approach uses SUMMARIZE to create a temporary table grouped by month, then uses SUMX to iterate over it and aggregate the revenue changes. While this works perfectly fine, it may be &lt;STRONG&gt;less performant&lt;/STRONG&gt; on large datasets due to the table creation step.&lt;/P&gt;
&lt;P&gt;sum_updownsell_product =&lt;/P&gt;
&lt;P&gt;SUMX(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUMMARIZE(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ARRDATA_CUSTOMER_PRODUCT,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ARRDATA_CUSTOMER_PRODUCT[MONTH],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MonthlyRevenueChange", SUM([revenue_change_product])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [MonthlyRevenueChange]&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this helped solve the issue, please consider marking it&amp;nbsp;&lt;STRONG&gt;'Accept as Solution&lt;/STRONG&gt;' so others with similar queries may find it more easily. If not, please share the details, always happy to help.&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2025 10:47:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4630266#M177256</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-03-29T10:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4632633#M177363</link>
      <description>&lt;P&gt;You could try something like below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;revenue_change_product =
CALCULATE(SUM(ARRDATA_CUSTOMER_PRODUCT[ARR_AMOUNT]) - [PRE_CROSS-SELL1], KEEPFILTERS(ARRDATA_CUSTOMER_PRODUCT[CATEGORY_PRODUCT] = "CROSS-SELLPRODUCT1")
+ CALCULATE(SUM(ARRDATA_CUSTOMER_PRODUCT[ARR_AMOUNT]) - [PRE_LOST_PRODUCT1], KEEPFILTERS(ARRDATA_CUSTOMER_PRODUCT[CATEGORY_PRODUCT] = "LOST-PRODUCTPRODUCT1")
+ CALCULATE(SUM(ARRDATA_CUSTOMER_PRODUCT[ARR_AMOUNT]) - [PRE_REACT_PRODUCT1], KEEPFILTERS(ARRDATA_CUSTOMER_PRODUCT[CATEGORY_PRODUCT] = "PRODUCT REACTIVATIONPRODUCT1")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Apr 2025 07:32:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4632633#M177363</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-04-01T07:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4640750#M177679</link>
      <description>&lt;P&gt;&lt;SPAN data-teams="true"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1244016" data-lia-user-login="VT_KMS" class="lia-mention lia-mention-user"&gt;VT_KMS&lt;/a&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 10:11:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4640750#M177679</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-04-07T10:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4646769#M177866</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1244016" target="_blank"&gt;@VT_KMS&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;&lt;SPAN&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 11:36:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4646769#M177866</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-04-10T11:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Aggregating Measures Using SELECTEDVALUE()</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4657050#M178304</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1244016" target="_blank" rel="noopener"&gt;@VT_KMS&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, We are closing this thread as we haven't heard from you in a while, according to our follow-up policy. If you have any more questions, please start a new thread on the Microsoft Fabric Community Forum. We will be happy to assist you! Thank you for being part of the community!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 07:34:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Aggregating-Measures-Using-SELECTEDVALUE/m-p/4657050#M178304</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-06-16T07:34:33Z</dc:date>
    </item>
  </channel>
</rss>

