<?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: Looking for records where two variables are swapped in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2533672#M71129</link>
    <description>&lt;P&gt;I set up the secondary key in the model. It works. Thank you&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 14:30:51 GMT</pubDate>
    <dc:creator>flyingfox</dc:creator>
    <dc:date>2022-05-23T14:30:51Z</dc:date>
    <item>
      <title>Looking for records where two variables are swapped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2522994#M70439</link>
      <description>&lt;P&gt;Hi, I am trying to figure out how to implement this scenario with DAX.&lt;/P&gt;&lt;P&gt;Consider the following matrix with three columns&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;parameter&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;cost&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;AB&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;AC&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 2&lt;/P&gt;&lt;/TD&gt;&lt;T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&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;52&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ID column is the concatenation of two variables that can be combined. I would like to find in the table all the records in which the two variables are swapped among each other.&lt;/P&gt;&lt;P&gt;The final result needs to be&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;parameter&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;cost&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;AC&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CA&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;40&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CA&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;52&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;EF&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;67&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;FE&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 7&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;80&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;EF&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parameter 8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;45&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Thank you for your support&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 09:56:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2522994#M70439</guid>
      <dc:creator>flyingfox</dc:creator>
      <dc:date>2022-05-18T09:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for records where two variables are swapped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2531857#M71041</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="359535" data-lia-user-login="flyingfox" class="lia-mention lia-mention-user"&gt;flyingfox&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try the following methods.&lt;/P&gt;
&lt;P&gt;Column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;id2 = RIGHT('Table'[id],1)&amp;amp;LEFT('Table'[id],1)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New Table = UNION(VALUES('Table'[id]),VALUES('Table'[id2]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count id =
CALCULATE (
    COUNT ( 'New Table'[id] ),
    FILTER ( ALL ( 'New Table' ), [id] = SELECTEDVALUE ( 'New Table'[id] ) )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure = IF([Count id]=1,0,1)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Drag Measure into the view to be displayed and set it equal to 1.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 02:45:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2531857#M71041</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-05-23T02:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for records where two variables are swapped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2533522#M71123</link>
      <description>&lt;P&gt;Dear Team_Charlotte,&lt;/P&gt;&lt;P&gt;thank you so much for your valuable support. You undestood my issue and you almost got the result because, I am sorry, I did not mention that each record in the master Table is associated to a date. Therefore&amp;nbsp;d&lt;SPAN&gt;ragging your interesting Measure into the view to be displayed and setting it equal to 1, it does not produce the desidered results because the filter does not work due to the missing date in the New Table. Could you help me, please?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 13:30:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2533522#M71123</guid>
      <dc:creator>flyingfox</dc:creator>
      <dc:date>2022-05-23T13:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for records where two variables are swapped</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2533672#M71129</link>
      <description>&lt;P&gt;I set up the secondary key in the model. It works. Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 14:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-records-where-two-variables-are-swapped/m-p/2533672#M71129</guid>
      <dc:creator>flyingfox</dc:creator>
      <dc:date>2022-05-23T14:30:51Z</dc:date>
    </item>
  </channel>
</rss>

