<?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: Selected Value Blank in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/2676832#M80025</link>
    <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;!&amp;nbsp;&amp;nbsp;This helped me solve a similar issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I had created a numeric measure using SUM() and a filter for [field] = SELECTEDVALUES([other field]).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Individual rows were returning the expected SUM() in my matrix visualization (since [other field] would have a single value within a single row's row context).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, the Total row in the matrix was blank.&amp;nbsp; &amp;nbsp;I figured out this was due to the fact that the row context for the Total row would have multiple values for [other field] and, therefore, SELECTEDVALUE([other field]) in that row context would return null and, therefore, the SUM() was null.&lt;BR /&gt;&lt;BR /&gt;After reading your post, I was able to update my formula to filter by IN VALUES([other field] and now my SUM(), SUMX() actually, is returning the correct, summed values for the Total row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FilteredSum =
/* Create a one-column table of Table1 key values for the current row context.
 * (This method, using VALUES() instead of SELECTEDVALUE() to get the value for the 
 * current row/row context, is necessary in order to SUM() the measure when 
 * there could be multiple "selected values" within the "Total" row context.) */
VAR t1KeyValues = VALUES('Table1'[T1_KEY])
RETURN
    SUMX(
        FILTER(
            'Table2', 
            'Table2'[T2_KEY] IN t1KeyValues
        ), 
        [T2_VALUE_TO_SUM]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 00:42:08 GMT</pubDate>
    <dc:creator>jmweekes</dc:creator>
    <dc:date>2022-08-03T00:42:08Z</dc:date>
    <item>
      <title>Selected Value Blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/837363#M6249</link>
      <description>&lt;P&gt;Hi Guys, So I have two tables :&lt;BR /&gt;a. Name Master table&lt;BR /&gt;b.Data table&lt;/P&gt;&lt;P&gt;And a visual which contains all the names from the Name Master table&lt;BR /&gt;&lt;BR /&gt;Name in the "Data table" can be in 6 different columns. The Name Master table is related to all 6 Columns&lt;BR /&gt;So my aim is to calculate an expression but for that I need to check in which of the 6 columns that name is present and then filter that "Data table" according in which column it has been found. Below is the Dax which I tried to write for returning the selected name but it is giving me blank at some places.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Selected Name= SELECTEDVALUE( Name_Master_List[Name])&lt;/LI-CODE&gt;&lt;P&gt;Please help me guys I cant think anymore.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 11:39:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/837363#M6249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-05T11:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value Blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/837489#M6258</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/a&gt; ,&lt;BR /&gt;&lt;BR /&gt;here is one way of achieving what you want to do:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
VAR _names =
    VALUES ( Master[name] )
VAR _c1 =
    CALCULATE ( SUM ( data[sales] ); FILTER ( data; data[Column1] IN _names ) )
VAR _c2 =
    CALCULATE ( SUM ( data[sales] ); FILTER ( data; data[Column2] IN _names ) )
VAR _c3 =
    CALCULATE ( SUM ( data[sales] ); FILTER ( data; data[Column3] IN _names ) )
VAR _c4 =
    CALCULATE ( SUM ( data[sales] ); FILTER ( data; data[Column4] IN _names ) )
RETURN
    _c1 + _c2 + _c3 + _c4&lt;/LI-CODE&gt;&lt;P&gt;although with only 4 columns, but you get the picture. For this to work, you need to remove all the connections between Master and Data.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Sturla&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accepting it as the solution. Kudos are nice too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 14:22:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/837489#M6258</guid>
      <dc:creator>sturlaws</dc:creator>
      <dc:date>2019-11-05T14:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value Blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/838218#M6286</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;Can we connect somewhere it will be easy to explain you the scenario&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 05:40:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/838218#M6286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T05:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value Blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/2676832#M80025</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;!&amp;nbsp;&amp;nbsp;This helped me solve a similar issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I had created a numeric measure using SUM() and a filter for [field] = SELECTEDVALUES([other field]).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Individual rows were returning the expected SUM() in my matrix visualization (since [other field] would have a single value within a single row's row context).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, the Total row in the matrix was blank.&amp;nbsp; &amp;nbsp;I figured out this was due to the fact that the row context for the Total row would have multiple values for [other field] and, therefore, SELECTEDVALUE([other field]) in that row context would return null and, therefore, the SUM() was null.&lt;BR /&gt;&lt;BR /&gt;After reading your post, I was able to update my formula to filter by IN VALUES([other field] and now my SUM(), SUMX() actually, is returning the correct, summed values for the Total row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FilteredSum =
/* Create a one-column table of Table1 key values for the current row context.
 * (This method, using VALUES() instead of SELECTEDVALUE() to get the value for the 
 * current row/row context, is necessary in order to SUM() the measure when 
 * there could be multiple "selected values" within the "Total" row context.) */
VAR t1KeyValues = VALUES('Table1'[T1_KEY])
RETURN
    SUMX(
        FILTER(
            'Table2', 
            'Table2'[T2_KEY] IN t1KeyValues
        ), 
        [T2_VALUE_TO_SUM]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 00:42:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-Value-Blank/m-p/2676832#M80025</guid>
      <dc:creator>jmweekes</dc:creator>
      <dc:date>2022-08-03T00:42:08Z</dc:date>
    </item>
  </channel>
</rss>

