<?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 Using an interim measure as a filter to create new table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-an-interim-measure-as-a-filter-to-create-new-table/m-p/3155161#M156770</link>
    <description>&lt;P&gt;I am using an interm measure in Filter funtion which is not giving me desired result, tried using VAR as well but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dataset&lt;/STRONG&gt;: "Inventory" table has 3 Columns, PanelID (Unique ID for each row), ReachIndex(HIGH, Medium, LOW), Reach(reach for each panel)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requirement&lt;/STRONG&gt;: Based on the user input, I must display 20% HIGH ReachIndex panels, 70% Medium ReachIndex panels and 10% LOW ReachIndex panels from inventory table in a new table called "Selection".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;: if user input is 20, "Selection" table must display any 4 HIGH, 14 Medium and 2 LOW panels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Implimentation&lt;/STRONG&gt; : I have used what if parameter to take user input and calculated dax measures to calucalte number of panels to be displayed for each ReachIndexe types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HighIndexPanels = ROUNDDOWN(Parameter[Parameter Value] * 0.20, 0)&lt;BR /&gt;MediumIndexPanels = ROUNDUP(Parameter[Parameter Value] * 0.7, 0)&lt;BR /&gt;LOWIndexPanels = Parameter[Parameter Value] - HighIndexPanels - MediumIndexPanels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculated column "CoulmnIndexRank" to assign ranks to panels within each ReachIndex types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ColumnIndexRank = &lt;/SPAN&gt;&lt;SPAN&gt;RANKX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Inventory'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Inventory'&lt;/SPAN&gt;&lt;SPAN&gt;[ReachIndex]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;EARLIER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Inventory'&lt;/SPAN&gt;&lt;SPAN&gt;[ReachIndex]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ), &lt;/SPAN&gt;&lt;SPAN&gt;Inventory&lt;/SPAN&gt;&lt;SPAN&gt;[Reach]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;created "Selection" table with below DAX code (Will implement for all ReachIndex types once I get expected result for 'Medium' ReachIndex type. )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Selection =&lt;BR /&gt;var m = [MediumIndexPanels]&lt;BR /&gt;return&lt;BR /&gt;FILTER (&lt;BR /&gt;Inventory,&lt;BR /&gt;Inventory[ColumnIndexRank] &amp;lt;= m &amp;amp;&amp;amp; Inventory[ReachIndex] = "Medium"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;This is showing me just one panel for all user inputs. For example when I input 20 panels, Selection table is showing only one panel where as it is suppose to show 14 panels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="8501" data-lia-user-login="Datatouille" class="lia-mention lia-mention-user"&gt;Datatouille&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="98062" data-lia-user-login="MartynRamsden" class="lia-mention lia-mention-user"&gt;MartynRamsden&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="80452" data-lia-user-login="needhelp" class="lia-mention lia-mention-user"&gt;needhelp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2023 12:14:40 GMT</pubDate>
    <dc:creator>JeevanHT</dc:creator>
    <dc:date>2023-03-27T12:14:40Z</dc:date>
    <item>
      <title>Using an interim measure as a filter to create new table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-an-interim-measure-as-a-filter-to-create-new-table/m-p/3155161#M156770</link>
      <description>&lt;P&gt;I am using an interm measure in Filter funtion which is not giving me desired result, tried using VAR as well but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dataset&lt;/STRONG&gt;: "Inventory" table has 3 Columns, PanelID (Unique ID for each row), ReachIndex(HIGH, Medium, LOW), Reach(reach for each panel)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requirement&lt;/STRONG&gt;: Based on the user input, I must display 20% HIGH ReachIndex panels, 70% Medium ReachIndex panels and 10% LOW ReachIndex panels from inventory table in a new table called "Selection".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;: if user input is 20, "Selection" table must display any 4 HIGH, 14 Medium and 2 LOW panels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Implimentation&lt;/STRONG&gt; : I have used what if parameter to take user input and calculated dax measures to calucalte number of panels to be displayed for each ReachIndexe types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HighIndexPanels = ROUNDDOWN(Parameter[Parameter Value] * 0.20, 0)&lt;BR /&gt;MediumIndexPanels = ROUNDUP(Parameter[Parameter Value] * 0.7, 0)&lt;BR /&gt;LOWIndexPanels = Parameter[Parameter Value] - HighIndexPanels - MediumIndexPanels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculated column "CoulmnIndexRank" to assign ranks to panels within each ReachIndex types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ColumnIndexRank = &lt;/SPAN&gt;&lt;SPAN&gt;RANKX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Inventory'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Inventory'&lt;/SPAN&gt;&lt;SPAN&gt;[ReachIndex]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;EARLIER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Inventory'&lt;/SPAN&gt;&lt;SPAN&gt;[ReachIndex]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ), &lt;/SPAN&gt;&lt;SPAN&gt;Inventory&lt;/SPAN&gt;&lt;SPAN&gt;[Reach]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;created "Selection" table with below DAX code (Will implement for all ReachIndex types once I get expected result for 'Medium' ReachIndex type. )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Selection =&lt;BR /&gt;var m = [MediumIndexPanels]&lt;BR /&gt;return&lt;BR /&gt;FILTER (&lt;BR /&gt;Inventory,&lt;BR /&gt;Inventory[ColumnIndexRank] &amp;lt;= m &amp;amp;&amp;amp; Inventory[ReachIndex] = "Medium"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;This is showing me just one panel for all user inputs. For example when I input 20 panels, Selection table is showing only one panel where as it is suppose to show 14 panels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="8501" data-lia-user-login="Datatouille" class="lia-mention lia-mention-user"&gt;Datatouille&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="98062" data-lia-user-login="MartynRamsden" class="lia-mention lia-mention-user"&gt;MartynRamsden&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="80452" data-lia-user-login="needhelp" class="lia-mention lia-mention-user"&gt;needhelp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 12:14:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-an-interim-measure-as-a-filter-to-create-new-table/m-p/3155161#M156770</guid>
      <dc:creator>JeevanHT</dc:creator>
      <dc:date>2023-03-27T12:14:40Z</dc:date>
    </item>
  </channel>
</rss>

