<?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 Measure for query using IN statement in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4022996#M158754</link>
    <description>&lt;P&gt;Hello, I need to write a measure to do the following query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT count(*)&lt;BR /&gt;FROM table 1 a&lt;BR /&gt;WHERE a.code IN&lt;BR /&gt;(select b.code from table 2 b where b.id = selectedvalue(table3[id])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help/suggestions, Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 13:36:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-03T13:36:12Z</dc:date>
    <item>
      <title>Measure for query using IN statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4022996#M158754</link>
      <description>&lt;P&gt;Hello, I need to write a measure to do the following query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT count(*)&lt;BR /&gt;FROM table 1 a&lt;BR /&gt;WHERE a.code IN&lt;BR /&gt;(select b.code from table 2 b where b.id = selectedvalue(table3[id])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help/suggestions, Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 13:36:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4022996#M158754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-03T13:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for query using IN statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023052#M158755</link>
      <description>&lt;P&gt;Try this measure out&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SelectedCount = 
VAR SelectedID = SELECTEDVALUE(Table3[id])
VAR FilteredCodes = 
    CALCULATETABLE(
        VALUES(Table2[code]),
        Table2[id] = SelectedID
    )
RETURN
    CALCULATE(
        COUNTROWS(Table1),
        Table1[code] IN FilteredCodes
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 14:14:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023052#M158755</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2024-07-03T14:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for query using IN statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023187#M158768</link>
      <description>&lt;P&gt;Thanks for a quick respond! When tried your solution it took loong time and got a message "Couldn't load the data for this visual". Table1 has more than 10 mln records and I have filters for visuals on the page. May be I need to add filters to the measure also? If you can add to your solution for table1 source_id = 1 and service_id = 2 ? Many thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 15:18:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023187#M158768</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-03T15:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for query using IN statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023211#M158770</link>
      <description>&lt;P&gt;I tried to refactor the DAX&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SelectedCount = 
VAR SelectedID = SELECTEDVALUE(Table3[id])
RETURN
    CALCULATE(
        COUNTROWS(Table1),
        FILTER(
            Table1,
            Table1[code] IN 
            CALCULATETABLE(
                VALUES(Table2[code]),
                Table2[id] = SelectedID
            )
        )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Jul 2024 15:27:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023211#M158770</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2024-07-03T15:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for query using IN statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023288#M158776</link>
      <description>&lt;P&gt;Thanks! I tried refactor measure and got nothing unfortunately...&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 15:50:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4023288#M158776</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-03T15:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for query using IN statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4060657#M161177</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 07:09:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-query-using-IN-statement/m-p/4060657#M161177</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-25T07:09:06Z</dc:date>
    </item>
  </channel>
</rss>

