<?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 Return Items that have Neither Item Selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4339920#M172318</link>
    <description>&lt;P&gt;&lt;STRONG&gt;A DAX Puzzler:&amp;nbsp;&lt;/STRONG&gt; I have an inventory problem I'm trying to solve.&amp;nbsp; Each location has inventory in a table TableQOHRemoveZeros.&amp;nbsp; &amp;nbsp;If I select the items in the slicer, I want it to return locations that have NEITHER item.&amp;nbsp; E.g.&amp;nbsp; if I select iPhone 12 and iPhone 13 in the Slicer, the only location that should return is Location 114 Plum Lane.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DISTINCT(TableQOHRemoveZeros[Device Name Short])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that I could query this table after the items were selected against all of the locations using Except, but I don't think it's possible to query a table created by slicer selection.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;LocationsWithoutSelectedDevices2 = VAR SelectedLocations= ALLSELECTED(DisDeviceNameShort[Device Name Short]) VAR AllLocations = All('Current Hierarchy'[Sales Code]) Var ExcludeSelectedLocation = EXCEPT(SelectedLocations,AllLocations) Return (ExcludeSelectedLocation)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:"A table with multiple values was returned when a single value expected" A real doozy.&amp;nbsp; &amp;nbsp;Any way to achieve this?&amp;nbsp; I think it would have huge benefit to others as well and would greatly streamline a process like this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Sales Code&lt;/TD&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;Device Name Short&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;123 Main St&lt;/TD&gt;&lt;TD&gt;iPhone 12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;123 Main St&lt;/TD&gt;&lt;TD&gt;Iphone 16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;123 Main St&lt;/TD&gt;&lt;TD&gt;Iphone 11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;111 Elm St&lt;/TD&gt;&lt;TD&gt;Iphone 10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;111 Elm St&lt;/TD&gt;&lt;TD&gt;Iphone 13&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;111 Elm St&lt;/TD&gt;&lt;TD&gt;iPhone 14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;800 Plum ln&lt;/TD&gt;&lt;TD&gt;iPhone 15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;800 Plum ln&lt;/TD&gt;&lt;TD&gt;iPhone 16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;800 Plum ln&lt;/TD&gt;&lt;TD&gt;iPhone 17&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Sun, 22 Dec 2024 21:12:35 GMT</pubDate>
    <dc:creator>BrianNeedsHelp</dc:creator>
    <dc:date>2024-12-22T21:12:35Z</dc:date>
    <item>
      <title>Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4339920#M172318</link>
      <description>&lt;P&gt;&lt;STRONG&gt;A DAX Puzzler:&amp;nbsp;&lt;/STRONG&gt; I have an inventory problem I'm trying to solve.&amp;nbsp; Each location has inventory in a table TableQOHRemoveZeros.&amp;nbsp; &amp;nbsp;If I select the items in the slicer, I want it to return locations that have NEITHER item.&amp;nbsp; E.g.&amp;nbsp; if I select iPhone 12 and iPhone 13 in the Slicer, the only location that should return is Location 114 Plum Lane.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DISTINCT(TableQOHRemoveZeros[Device Name Short])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that I could query this table after the items were selected against all of the locations using Except, but I don't think it's possible to query a table created by slicer selection.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;LocationsWithoutSelectedDevices2 = VAR SelectedLocations= ALLSELECTED(DisDeviceNameShort[Device Name Short]) VAR AllLocations = All('Current Hierarchy'[Sales Code]) Var ExcludeSelectedLocation = EXCEPT(SelectedLocations,AllLocations) Return (ExcludeSelectedLocation)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:"A table with multiple values was returned when a single value expected" A real doozy.&amp;nbsp; &amp;nbsp;Any way to achieve this?&amp;nbsp; I think it would have huge benefit to others as well and would greatly streamline a process like this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Sales Code&lt;/TD&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;Device Name Short&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;123 Main St&lt;/TD&gt;&lt;TD&gt;iPhone 12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;123 Main St&lt;/TD&gt;&lt;TD&gt;Iphone 16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;123 Main St&lt;/TD&gt;&lt;TD&gt;Iphone 11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;111 Elm St&lt;/TD&gt;&lt;TD&gt;Iphone 10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;111 Elm St&lt;/TD&gt;&lt;TD&gt;Iphone 13&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;111 Elm St&lt;/TD&gt;&lt;TD&gt;iPhone 14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;800 Plum ln&lt;/TD&gt;&lt;TD&gt;iPhone 15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;800 Plum ln&lt;/TD&gt;&lt;TD&gt;iPhone 16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;800 Plum ln&lt;/TD&gt;&lt;TD&gt;iPhone 17&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 22 Dec 2024 21:12:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4339920#M172318</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-12-22T21:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340118#M172326</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Deviace Name short: = 
VAR _slicerselect =
    VALUES ( Slicer[Device Name Short] )
VAR _salescodelist =
    SUMMARIZE (
        FILTER (
            ALL ( TableQOHRemoveZeros ),
            TableQOHRemoveZeros[Device Name Short] IN _slicerselect
        ),
        TableQOHRemoveZeros[Sales Code]
    )
VAR _others =
    EXCEPT (
        SUMMARIZE ( ALL ( TableQOHRemoveZeros ), TableQOHRemoveZeros[Sales Code] ),
        _salescodelist
    )
RETURN
    CALCULATE (
        MAX ( TableQOHRemoveZeros[Device Name Short] ),
        FILTER ( TableQOHRemoveZeros, TableQOHRemoveZeros[Sales Code] IN _others )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 03:55:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340118#M172326</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-12-23T03:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340158#M172327</link>
      <description>&lt;P&gt;This is amazing!&amp;nbsp; Would it be possible for you to tweak it to only show the location and not all the device names?&amp;nbsp; A distinct location returned for locations that have neither device.&amp;nbsp; So it would return like this:&amp;nbsp; Sales Code&amp;nbsp; &amp;nbsp;Location&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 114&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;800 Plum Lane&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 04:43:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340158#M172327</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-12-23T04:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340182#M172328</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for your message, and one of ways is to put the measure to the Filter Pane -&amp;gt; Filters on this visual area, like the below image.&lt;BR /&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 05:04:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340182#M172328</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-12-23T05:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340188#M172329</link>
      <description>&lt;P&gt;You are amazing &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;!&amp;nbsp; &amp;nbsp;Thank you so much-This is so awesome!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 05:07:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340188#M172329</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-12-23T05:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340251#M172333</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="828752" data-lia-user-login="BrianNeedsHelp" class="lia-mention lia-mention-user"&gt;BrianNeedsHelp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;PRE&gt;LocationsWithoutSelectedDevices =&lt;BR /&gt;VAR SelectedDevices = ALLSELECTED(TableQOHRemoveZeros[Device Name Short])&lt;BR /&gt;VAR LocationsWithSelectedDevices =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;FILTER(&lt;BR /&gt;TableQOHRemoveZeros,&lt;BR /&gt;TableQOHRemoveZeros[Device Name Short] IN SelectedDevices&lt;BR /&gt;),&lt;BR /&gt;TableQOHRemoveZeros[Sales Code]&lt;BR /&gt;)&lt;BR /&gt;VAR AllLocations = VALUES(TableQOHRemoveZeros[Sales Code])&lt;BR /&gt;VAR LocationsWithoutDevices =&lt;BR /&gt;EXCEPT(&lt;BR /&gt;AllLocations,&lt;BR /&gt;LocationsWithSelectedDevices&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;SELECTEDVALUE(TableQOHRemoveZeros[Sales Code]) IN LocationsWithoutDevices,&lt;BR /&gt;1,&lt;BR /&gt;0&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":love_letter:"&gt;💌&lt;/span&gt; &lt;STRONG&gt;If this helped, a Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; or Solution mark &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; would be great! &lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Cheers,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Kedar&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 05:46:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4340251#M172333</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2024-12-23T05:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Return Items that have Neither Item Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4347411#M172657</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="568855" data-lia-user-login="Kedar_Pande" class="lia-mention lia-mention-user"&gt;Kedar_Pande&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp; &amp;nbsp; I combined several table columns&amp;nbsp; together using Summarize to get into one table.&amp;nbsp; &amp;nbsp;I'm having issues getting everything to display properly.&amp;nbsp; So I went back to try and use this code with the original tables, and I'm getting error "expression refers to multiple columns.Multiple columns cannot be converted to a scalar value."&amp;nbsp; Not sure I formatted this correctly, but the only wat it would allow me to use other tables was to type RELATEDTABLE.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LocationsWithoutSelectedDevices1 = 

VAR _slicerselect =
    VALUES ( DisDeviceName[Device Name] )
VAR _salescodelist =
    SUMMARIZE 
       (FILTER (
            ALL ('Location'),
           Filter(RELATEDTABLE( 'Item Code'),'Item Code'[Device Name] IN _slicerselect) &amp;amp;&amp;amp; Filter(RELATEDTABLE('Device Inventory On Hand'),'Device Inventory On Hand'[Device Inventory QOH])&amp;lt;&amp;gt;0 ),
          Location[Sales Code]      
    )
VAR _others =
    EXCEPT (
        SUMMARIZE ( ALL ( Location ), Location[Sales Code] ),
        _salescodelist
    )
RETURN
    CALCULATE(
        MAX (Location[Location] ),
        FILTER ( Location, Location[Sales Code] IN _others )
    )&lt;/LI-CODE&gt;&lt;P&gt;Please help adapt code to use with separate tables.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 18:48:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-Items-that-have-Neither-Item-Selected/m-p/4347411#M172657</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-12-31T18:48:42Z</dc:date>
    </item>
  </channel>
</rss>

