<?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: AND Multiple Selectedvalue in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984617#M43823</link>
    <description>&lt;P&gt;Hey daxer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much for your answer. I may be to far away from DAX-Code like in the video, but I somehow figured my own Workaround. It sure is not perfect, but works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Target = IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(ISFILTERED('Table A'[Names]),CONCATENATEX(VALUES('Table A'[Names]),'Table A'[Names], " | "),"")="Thomas | Nick"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;||SELECTEDVALUE('Table A'[Names])="Thomas"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;||SELECTEDVALUE('Table A'[Names])="Nick"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;,1,2)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MSOMME&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 28 Jul 2021 11:30:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-28T11:30:04Z</dc:date>
    <item>
      <title>AND Multiple Selectedvalue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984162#M43805</link>
      <description>&lt;P&gt;Hey!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to create&amp;nbsp; a target based on the selections in a slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Target = IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;U&gt;AND(SELECTEDVALUE('Table A'[Names])="Thomas",SELECTEDVALUE('Table A'[Names])="Nick")&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;||SELECTEDVALUE('Return Delivery'[PartStatus1])="Thomas"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;||SELECTEDVALUE('Return Delivery'[PartStatus1])="Nick",1,2)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The target if I select only Thomas is 1 like expected. The same goes for Nick. But I want the target to be 1, when I select Thomas AND Nick. So I guess there is something wrong with my underlined part.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All help is very appreciated!&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MSOMME&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Jul 2021 09:00:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984162#M43805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T09:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: AND Multiple Selectedvalue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984354#M43815</link>
      <description>&lt;P&gt;Of course it's wrong. The logic says: if &lt;STRONG&gt;the same&lt;/STRONG&gt; field selected in the table is at the same time Nick and Thomas... then do this. Well, this will never be true since SELECTEDVALUE always returns only one name, never both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do what you're asking for requires some non-trival effort. Please start with this vid:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=l5JX3G5Ntzk" target="_blank"&gt;(1) Using OR conditions between slicers in DAX - YouTube&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 09:58:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984354#M43815</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T09:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: AND Multiple Selectedvalue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984617#M43823</link>
      <description>&lt;P&gt;Hey daxer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much for your answer. I may be to far away from DAX-Code like in the video, but I somehow figured my own Workaround. It sure is not perfect, but works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Target = IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(ISFILTERED('Table A'[Names]),CONCATENATEX(VALUES('Table A'[Names]),'Table A'[Names], " | "),"")="Thomas | Nick"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;||SELECTEDVALUE('Table A'[Names])="Thomas"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;||SELECTEDVALUE('Table A'[Names])="Nick"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;,1,2)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MSOMME&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Jul 2021 11:30:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984617#M43823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T11:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: AND Multiple Selectedvalue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984689#M43824</link>
      <description>&lt;LI-CODE lang="csharp"&gt;Target =
VAR VisibleNames =
    VALUES( 'Table A'[Names] )
var DesiredNames = 
	{"Nick", "Thomas"}
var Union_ =
	// This union will have 2 elements
	// only when VisibleNames is a subset
	// of DesiredSet.
	DISTINCT(
		union(
			VisibleNames,
			DesiredNames
		)
	)
var DesiredNamesCard =
	COUNTROWS( DesiredNames )
var UnionCard =
	COUNTROWS( Union_ )
VAR Result =
    IF( UnionCard = DesiredNamesCard,
        1,
        2
    )
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;Here's the code you probably wanted to write. CONCATENATEX is a function which should not be used in your scenario. This is not what it's been meant for. The above code is flexible and expresses clearly your idea. For instance, ff you wanted to put more names in the DesiredNames set, you could do it and the code would behave correctly as well (only one change is needed to DesiredNames). If you wanted to change the names, you'd change them in one place only. This is what's called: CLEAN CODE. No repetitions are present and you probably know that in programming repeated code is the source of all evil.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 11:54:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984689#M43824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T11:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: AND Multiple Selectedvalue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984709#M43825</link>
      <description>&lt;P&gt;Hey daxer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is alot better. Thank you very much! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;MSOMME&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 12:00:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/AND-Multiple-Selectedvalue/m-p/1984709#M43825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T12:00:23Z</dc:date>
    </item>
  </channel>
</rss>

