<?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: Count the occurrence of the value in 3 different tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288897#M170220</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a card visual, there is no row context to filter the tables, so SELECTEDVALUE or similar row-based filtering won't work properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correct Measure:&lt;/P&gt;&lt;PRE&gt;Measure =&lt;BR /&gt;VAR TableBIDs = DISTINCT('Table B'[Unique_ID])&lt;BR /&gt;VAR TableCIDs = DISTINCT('Table C'[Unique_ID])&lt;BR /&gt;VAR CombinedIDs = UNION(TableBIDs, TableCIDs)&lt;BR /&gt;VAR IDsInA = FILTER(CombinedIDs, NOT(ISBLANK(LOOKUPVALUE('Table A'[Unique_ID], 'Table A'[Unique_ID], [Unique_ID]))))&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(IDsInA)&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":love_letter:"&gt;💌&lt;/span&gt; If this helped, a Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; or Solution mark would be great! &lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Kedar&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Nov 2024 12:45:40 GMT</pubDate>
    <dc:creator>Kedar_Pande</dc:creator>
    <dc:date>2024-11-18T12:45:40Z</dc:date>
    <item>
      <title>Count the occurrence of the value in 3 different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288867#M170219</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;BR /&gt;I need to find how many times unique ID occures in table B and C and count how many times this Unique ID appears in table A.&lt;BR /&gt;In a card visual I need to display this value. So far I was trying below measure, and couple of different once, but nothhing works. It filters it correctly, but it does not show me the proper value in the Card visual.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_a&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'table A'&lt;/SPAN&gt;&lt;SPAN&gt;[Unique_ID]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_b&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPA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/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'TableA'&lt;/SPAN&gt;&lt;SPAN&gt;[Unique_ID]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Nov 2024 12:31:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288867#M170219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-18T12:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count the occurrence of the value in 3 different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288897#M170220</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a card visual, there is no row context to filter the tables, so SELECTEDVALUE or similar row-based filtering won't work properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correct Measure:&lt;/P&gt;&lt;PRE&gt;Measure =&lt;BR /&gt;VAR TableBIDs = DISTINCT('Table B'[Unique_ID])&lt;BR /&gt;VAR TableCIDs = DISTINCT('Table C'[Unique_ID])&lt;BR /&gt;VAR CombinedIDs = UNION(TableBIDs, TableCIDs)&lt;BR /&gt;VAR IDsInA = FILTER(CombinedIDs, NOT(ISBLANK(LOOKUPVALUE('Table A'[Unique_ID], 'Table A'[Unique_ID], [Unique_ID]))))&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(IDsInA)&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":love_letter:"&gt;💌&lt;/span&gt; If this helped, a Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; or Solution mark would be great! &lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Kedar&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 12:45:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288897#M170220</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2024-11-18T12:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count the occurrence of the value in 3 different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288954#M170225</link>
      <description>&lt;P&gt;Hi Kedar,&amp;nbsp;&lt;BR /&gt;Thank you, that works ! The only thing which I changed is below, as I wanted to only count distinct values from both columns B and C.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;VAR CombinedIDs = DISTINCT(UNION(TableBIDs, TableCIDs))&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 13:16:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-the-occurrence-of-the-value-in-3-different-tables/m-p/4288954#M170225</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-18T13:16:29Z</dc:date>
    </item>
  </channel>
</rss>

