<?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: Lookup values matching more than one columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3817917#M149310</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477760" data-lia-user-login="SintRa" class="lia-mention lia-mention-user"&gt;SintRa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can try the following DAX&lt;/P&gt;
&lt;P&gt;First, create a new column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _virtualTable =
    FILTER (
        CROSSJOIN (
            SELECTCOLUMNS ( 'Table1', "User1", 'Table1'[User], "Role1", 'Table1'[Role] ),
            SELECTCOLUMNS (
                'Table2',
                "User2", 'Table2'[User],
                "Role2", 'Table2'[Role],
                "Company", 'Table2'[Company]
            )
        ),
        [Role1] = [Role2]
            &amp;amp;&amp;amp; [User1] = [User2]
    )
RETURN
    IF (
        COUNTX (
            FILTER ( _virtualTable, 'Table1'[User] = [User1] &amp;amp;&amp;amp; 'Table1'[Role] = [Role1] ),
            [Company]
        )
            = BLANK (),
        0,
        COUNTX (
            FILTER ( _virtualTable, 'Table1'[User] = [User1] &amp;amp;&amp;amp; 'Table1'[Role] = [Role1] ),
            [Company]
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the second question, create a calculated table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table1NotInTable2 =
EXCEPT (
    SELECTCOLUMNS ( 'Table1', "User", 'Table1'[User], "Role", 'Table1'[Role] ),
    SELECTCOLUMNS ( 'Table2', "User", 'Table2'[User], "Role", 'Table2'[Role] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 6.0pt 0cm 0cm 0cm;"&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2024 06:25:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-08T06:25:31Z</dc:date>
    <item>
      <title>Lookup values matching more than one columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3812563#M149111</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following two tables and I would like to create:&lt;/P&gt;&lt;P&gt;1) A measure or column (not sure what is best) to return the number of companies&lt;BR /&gt;2) A calculate table to get records in table 1 which do no exist in table2 matching and returning user and Role columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you help me? I tried with Vlookup but I am not sure how to return and search using two columns&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 05:24:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3812563#M149111</guid>
      <dc:creator>SintRa</dc:creator>
      <dc:date>2024-04-05T05:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup values matching more than one columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3813046#M149123</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477760" data-lia-user-login="SintRa" class="lia-mention lia-mention-user"&gt;SintRa&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Number of Companies = COUNTROWS(DISTINCT('Table 1'[Company]))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Missing Records =&lt;BR /&gt;EXCEPT(&lt;BR /&gt;'Table 1',&lt;BR /&gt;'Table 2'&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 09:26:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3813046#M149123</guid>
      <dc:creator>johnbasha33</dc:creator>
      <dc:date>2024-04-05T09:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup values matching more than one columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3817917#M149310</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477760" data-lia-user-login="SintRa" class="lia-mention lia-mention-user"&gt;SintRa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can try the following DAX&lt;/P&gt;
&lt;P&gt;First, create a new column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _virtualTable =
    FILTER (
        CROSSJOIN (
            SELECTCOLUMNS ( 'Table1', "User1", 'Table1'[User], "Role1", 'Table1'[Role] ),
            SELECTCOLUMNS (
                'Table2',
                "User2", 'Table2'[User],
                "Role2", 'Table2'[Role],
                "Company", 'Table2'[Company]
            )
        ),
        [Role1] = [Role2]
            &amp;amp;&amp;amp; [User1] = [User2]
    )
RETURN
    IF (
        COUNTX (
            FILTER ( _virtualTable, 'Table1'[User] = [User1] &amp;amp;&amp;amp; 'Table1'[Role] = [Role1] ),
            [Company]
        )
            = BLANK (),
        0,
        COUNTX (
            FILTER ( _virtualTable, 'Table1'[User] = [User1] &amp;amp;&amp;amp; 'Table1'[Role] = [Role1] ),
            [Company]
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the second question, create a calculated table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table1NotInTable2 =
EXCEPT (
    SELECTCOLUMNS ( 'Table1', "User", 'Table1'[User], "Role", 'Table1'[Role] ),
    SELECTCOLUMNS ( 'Table2', "User", 'Table2'[User], "Role", 'Table2'[Role] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 6.0pt 0cm 0cm 0cm;"&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 06:25:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3817917#M149310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-08T06:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup values matching more than one columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3819331#M149372</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/a&gt;, it helps a lot! I could not reach this solution!!!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 11:45:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-values-matching-more-than-one-columns/m-p/3819331#M149372</guid>
      <dc:creator>SintRa</dc:creator>
      <dc:date>2024-04-08T11:45:13Z</dc:date>
    </item>
  </channel>
</rss>

