<?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: Trying to lookup value in table that has duplicates in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416586#M39729</link>
    <description>&lt;P&gt;You can solve this issue using LOOKUPVALUE or RELATED in DAX, or by creating a calculated column with EXISTS/LOOKUP functions.&lt;/P&gt;&lt;P&gt;Using LOOKUPVALUE calculated column in your DataTable:&lt;/P&gt;&lt;P&gt;MatchColumn = IF(&lt;BR /&gt;NOT(ISBLANK(LOOKUPVALUE(LookupTable[GroupAndMetric], LookupTable[GroupAndMetric], DataTable[GroupAndMetricID]))),&lt;BR /&gt;1, 0&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;If you have a relationship between the two tables, you can use Related:&lt;/P&gt;&lt;P&gt;MatchColumn = IF(NOT(ISBLANK(RELATED(LookupTable[GroupAndMetric]))), 1, 0)&lt;/P&gt;&lt;P&gt;this works only if LookupTable is related to DataTable on GroupAndMetricID.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;- Ensure LookupTable has unique values in GroupAndMetric (no duplicates).&lt;BR /&gt;- If there’s no direct relationship, use LOOKUPVALUE instead of RELATED.&lt;/P&gt;&lt;P&gt;Try these solutions and let me know if you need further clarification&lt;/P&gt;&lt;P&gt;If this response was helpful, please &lt;STRONG&gt;accept it as a solution&lt;/STRONG&gt; and give &lt;STRONG&gt;kudos&lt;/STRONG&gt; to support other community members&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2025 23:12:36 GMT</pubDate>
    <dc:creator>ArwaAldoud</dc:creator>
    <dc:date>2025-02-18T23:12:36Z</dc:date>
    <item>
      <title>Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4415524#M39719</link>
      <description>&lt;P&gt;I'm trying to lookup if a value exists in another table. This will determine whether to show/hide rows in the output based on whether there is a match.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my data table:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;GroupAndMetricID&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InpatientM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InpatientM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InpatientM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CommunityM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CommunityM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InpatientM59&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CommunityM59&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And my lookup table:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;GroupAndMetric&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InpatientM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CommunityM61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InpatientM59&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CommunityM59&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for each row in the data table I want to know if there is a matching value in the lookup table. I've tried these dax expressions, but get the errror&lt;EM&gt; 'a single value for column 'GroupAndMetricID' in table 'DataTable' cannot be determined...'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MatchColumn = IF(CONTAINS (DataTable, DataTable[GroupAndMetricID], LookupTable[GroupAndMetric] ),1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MatchColumn = IF(LookupTable[GroupAndMetric] IN SELECTCOLUMNS ( RELATEDTABLE ( 'DataTable' ), DataTable[GroupAndMetricID]),1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using measures and columns for this but still the same error. Can anyone suggest a solution?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 09:36:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4415524#M39719</guid>
      <dc:creator>Les111</dc:creator>
      <dc:date>2025-02-18T09:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416011#M39723</link>
      <description>&lt;P&gt;Please confirm if this is indeed for Report Server, or for a semantic model in the Power BI Service?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 13:47:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416011#M39723</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-02-18T13:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416014#M39724</link>
      <description>&lt;P&gt;Yes it's report server.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 13:50:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416014#M39724</guid>
      <dc:creator>Les111</dc:creator>
      <dc:date>2025-02-18T13:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416586#M39729</link>
      <description>&lt;P&gt;You can solve this issue using LOOKUPVALUE or RELATED in DAX, or by creating a calculated column with EXISTS/LOOKUP functions.&lt;/P&gt;&lt;P&gt;Using LOOKUPVALUE calculated column in your DataTable:&lt;/P&gt;&lt;P&gt;MatchColumn = IF(&lt;BR /&gt;NOT(ISBLANK(LOOKUPVALUE(LookupTable[GroupAndMetric], LookupTable[GroupAndMetric], DataTable[GroupAndMetricID]))),&lt;BR /&gt;1, 0&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;If you have a relationship between the two tables, you can use Related:&lt;/P&gt;&lt;P&gt;MatchColumn = IF(NOT(ISBLANK(RELATED(LookupTable[GroupAndMetric]))), 1, 0)&lt;/P&gt;&lt;P&gt;this works only if LookupTable is related to DataTable on GroupAndMetricID.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;- Ensure LookupTable has unique values in GroupAndMetric (no duplicates).&lt;BR /&gt;- If there’s no direct relationship, use LOOKUPVALUE instead of RELATED.&lt;/P&gt;&lt;P&gt;Try these solutions and let me know if you need further clarification&lt;/P&gt;&lt;P&gt;If this response was helpful, please &lt;STRONG&gt;accept it as a solution&lt;/STRONG&gt; and give &lt;STRONG&gt;kudos&lt;/STRONG&gt; to support other community members&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 23:12:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4416586#M39729</guid>
      <dc:creator>ArwaAldoud</dc:creator>
      <dc:date>2025-02-18T23:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4417035#M39740</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="235481" data-lia-user-login="Les111" class="lia-mention lia-mention-user"&gt;Les111&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached a document that has few ideas about this issue, please check.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 06:15:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4417035#M39740</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-02-19T06:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4417297#M39747</link>
      <description>&lt;P&gt;Thank you Arwa!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both these solutions work, but I'm using RELATED rather than LOOKUPVALUE as my tables are related and I'm assuming this is more efficient.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 08:25:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4417297#M39747</guid>
      <dc:creator>Les111</dc:creator>
      <dc:date>2025-02-19T08:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4417300#M39748</link>
      <description>&lt;P&gt;Thank you Poojara.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 08:27:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4417300#M39748</guid>
      <dc:creator>Les111</dc:creator>
      <dc:date>2025-02-19T08:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to lookup value in table that has duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4418451#M39753</link>
      <description>&lt;P&gt;You're welcome&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="235481" data-lia-user-login="Les111" class="lia-mention lia-mention-user"&gt;Les111&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, RELATED is more efficient when tables are already connected. Glad it worked&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 23:25:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Trying-to-lookup-value-in-table-that-has-duplicates/m-p/4418451#M39753</guid>
      <dc:creator>ArwaAldoud</dc:creator>
      <dc:date>2025-02-19T23:25:40Z</dc:date>
    </item>
  </channel>
</rss>

