<?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: Create a table using Distinct values from another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2992776#M100744</link>
    <description>&lt;P&gt;Thanks but unfortunately not the solution. The way I understand the SUMMARIZE function is that it can only summarize on a field in its own dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works:&amp;nbsp;&lt;SPAN&gt;slicerTable =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(Orders&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;[Materials_Code]&lt;/SPAN&gt;&lt;SPAN&gt;) and returns the distinct list of codes (but no descriptions of course).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;slicerTable =&lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;[Material_Code]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Materials&lt;/SPAN&gt;&lt;SPAN&gt;[Materials_Desc]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;fails with "The column 'Material_Desc' specified in the 'SUMMARIZE' function was not found in the input table." and any variation that puts a column from Materials in the query, fails with a similar message so your suggestion:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;SlicerTable =&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SUMMARIZE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Orders,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Materials[&lt;SPAN&gt;Material_Code&lt;/SPAN&gt;],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Materials[&lt;SPAN&gt;Material_Desc&lt;/SPAN&gt;]&lt;/DIV&gt;&lt;DIV&gt;)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;crashes with a similar message.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I think I may have to do multiple steps!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;\ PauSe&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 29 Dec 2022 07:15:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-29T07:15:56Z</dc:date>
    <item>
      <title>Create a table using Distinct values from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2991888#M100692</link>
      <description>&lt;P&gt;Let's say I have two tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ORDERS&lt;BR /&gt;--------&lt;BR /&gt;Order_Num, Material_Code, etc., etc.,&lt;BR /&gt;Ord001, 1001&lt;BR /&gt;Ord002, 1002&lt;BR /&gt;Ord003, 1003&lt;BR /&gt;Ord004, 1003&lt;BR /&gt;Ord005, 1001&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;MATERIALS&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;Material_Code, Material_Desc&lt;BR /&gt;1001, Blue&lt;BR /&gt;1002, Green&lt;BR /&gt;1003, Yellow&lt;BR /&gt;1004, Red&lt;BR /&gt;1005, Pink&lt;BR /&gt;etc, etc&lt;BR /&gt;etc etc&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;In reality my MATERIAL table is huge but I need to use Material Description as a slicer but I only want those descriptions showing that are actually in the current ORDER data, meaning each time the ORDER data is refreshed, the slicer should be refreshed. So I decided I needed a dynamic table to feed the slicer and based on the above data it would only contain:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MATERIAL_SLICER&lt;BR /&gt;----------------&lt;BR /&gt;Material_Code Material_Desc&lt;BR /&gt;1001 Blue&lt;BR /&gt;1002 Green&lt;BR /&gt;1003 Yellow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have tried various DAX such as SUMMARIZE, SUMMARIZECOLUMNS, CALCULATETABLE but I am not getting what I want. If I was to write this in pseudo SQL it would be something like this:&lt;/P&gt;&lt;P&gt;SELECT Material_Code, Material_Desc&lt;BR /&gt;FROM Material&lt;BR /&gt;WHERE Material_Code in (SELECT DISTINCT Material_Code from Orders)&lt;/P&gt;&lt;P&gt;What is the similar DAX syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\ paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 14:59:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2991888#M100692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-28T14:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table using Distinct values from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2991948#M100694</link>
      <description>&lt;P&gt;hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;try like:&lt;/DIV&gt;&lt;DIV&gt;SlicerTable =&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SUMMARIZE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Orders,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Materials[&lt;SPAN&gt;Material_Code&lt;/SPAN&gt;],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Materials[&lt;SPAN&gt;Material_Desc&lt;/SPAN&gt;]&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Dec 2022 15:51:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2991948#M100694</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-12-28T15:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table using Distinct values from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2992776#M100744</link>
      <description>&lt;P&gt;Thanks but unfortunately not the solution. The way I understand the SUMMARIZE function is that it can only summarize on a field in its own dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works:&amp;nbsp;&lt;SPAN&gt;slicerTable =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(Orders&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;[Materials_Code]&lt;/SPAN&gt;&lt;SPAN&gt;) and returns the distinct list of codes (but no descriptions of course).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;slicerTable =&lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Orders&lt;/SPAN&gt;&lt;SPAN&gt;[Material_Code]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Materials&lt;/SPAN&gt;&lt;SPAN&gt;[Materials_Desc]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;fails with "The column 'Material_Desc' specified in the 'SUMMARIZE' function was not found in the input table." and any variation that puts a column from Materials in the query, fails with a similar message so your suggestion:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;SlicerTable =&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SUMMARIZE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Orders,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Materials[&lt;SPAN&gt;Material_Code&lt;/SPAN&gt;],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Materials[&lt;SPAN&gt;Material_Desc&lt;/SPAN&gt;]&lt;/DIV&gt;&lt;DIV&gt;)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;crashes with a similar message.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I think I may have to do multiple steps!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;\ PauSe&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Dec 2022 07:15:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2992776#M100744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-29T07:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table using Distinct values from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2997387#M101061</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;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = FILTER('MATERIALS',[Material_Code] in VALUES(ORDERS[ Material_Code]))&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&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;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 01:39:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-table-using-Distinct-values-from-another-table/m-p/2997387#M101061</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2023-01-03T01:39:28Z</dc:date>
    </item>
  </channel>
</rss>

