<?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 Number of Rows based on multiple columns values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2095732#M47768</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Im relatively new in PowerBi and Im looking for some advice on how to solve a problem with my data&lt;/P&gt;&lt;P&gt;I have a table where represent the cycle time to each machine. I need to know the machine who has the highest cycle for a specific product so I can show only this value as my constrain in the process flow&lt;/P&gt;&lt;P&gt;My table is like this&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;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;Side&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Process&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Mach&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CT&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Top&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SMT&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ln1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Bottom&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SMT&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ln2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SL&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WSM1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module B&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Top&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SMT&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ln1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module B&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SL&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WSM1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module B&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Module A, the Constrain is SMT because there are two machines that need to process the product (top side and then Bottom side), therefore, the Total Cycle for the process is 22&lt;/P&gt;&lt;P&gt;For Module B, FA is the constrain since SMT only have one machine&lt;/P&gt;&lt;P&gt;My approach was to count the number of machines based on the product and the process to assure that I have the Total cycle Time and then evaluate the max cycle based on the product, process and this Total cycle,....But Im really lost with DAX functions&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Sep 2021 01:56:33 GMT</pubDate>
    <dc:creator>fzn4hs</dc:creator>
    <dc:date>2021-09-24T01:56:33Z</dc:date>
    <item>
      <title>Number of Rows based on multiple columns values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2095732#M47768</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Im relatively new in PowerBi and Im looking for some advice on how to solve a problem with my data&lt;/P&gt;&lt;P&gt;I have a table where represent the cycle time to each machine. I need to know the machine who has the highest cycle for a specific product so I can show only this value as my constrain in the process flow&lt;/P&gt;&lt;P&gt;My table is like this&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;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;Side&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Process&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Mach&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CT&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Top&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SMT&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ln1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Bottom&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SMT&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ln2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SL&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WSM1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module A&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module B&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Top&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SMT&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ln1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module B&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SL&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WSM1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Module B&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FA1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Module A, the Constrain is SMT because there are two machines that need to process the product (top side and then Bottom side), therefore, the Total Cycle for the process is 22&lt;/P&gt;&lt;P&gt;For Module B, FA is the constrain since SMT only have one machine&lt;/P&gt;&lt;P&gt;My approach was to count the number of machines based on the product and the process to assure that I have the Total cycle Time and then evaluate the max cycle based on the product, process and this Total cycle,....But Im really lost with DAX functions&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 01:56:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2095732#M47768</guid>
      <dc:creator>fzn4hs</dc:creator>
      <dc:date>2021-09-24T01:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Number of Rows based on multiple columns values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2095801#M47770</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="328344" data-lia-user-login="fzn4hs" class="lia-mention lia-mention-user"&gt;fzn4hs&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  // Assumes you have [Product] column in your visual
  VAR __Table = SUMMARIZE('Table',[Process],"__TotalCT",SUM('Table'[CT])
  VAR __Max = MAXX(__Table,[__TotalCT])
RETURN
  MAXX(FILTER(__Table,[__TotalCT]=__Max),[Process])&lt;/LI-CODE&gt;
&lt;P&gt;It's basically Lookup Min/Max.&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814" target="_blank"&gt;Lookup Min/Max - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 02:11:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2095801#M47770</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-24T02:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Number of Rows based on multiple columns values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2100895#M47944</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe Im doing something wrong...This is what I did&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Columns:&lt;/P&gt;&lt;P&gt;[Product]&amp;nbsp; &amp;nbsp; &amp;nbsp; [SIDE]&amp;nbsp; &amp;nbsp; &amp;nbsp;[PROCESS]&amp;nbsp; &amp;nbsp; &amp;nbsp;[MACH]&amp;nbsp; &amp;nbsp; &amp;nbsp;[CT]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According with the proposal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure =&lt;BR /&gt;//&amp;nbsp; I assume that &lt;STRONG&gt;__Table,&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;__TotalCT &lt;/STRONG&gt;and&lt;STRONG&gt;__Max&lt;/STRONG&gt; are the variables name&lt;/P&gt;&lt;P&gt;// I believe that 'Table' is the name of the table where this data resides. For me this table's name is &lt;STRONG&gt;CAP_TABLE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;VAR &lt;STRONG&gt;__Table&lt;/STRONG&gt; = SUMMARIZE('&lt;STRONG&gt;CAP_TABLE&lt;/STRONG&gt;',[Process],"&lt;STRONG&gt;__TotalCT&lt;/STRONG&gt; ",SUM('&lt;STRONG&gt;CAP_TABLE&lt;/STRONG&gt;'[CT])&lt;BR /&gt;VAR &lt;STRONG&gt;__Max&lt;/STRONG&gt; = MAXX(&lt;STRONG&gt;__Table&lt;/STRONG&gt; ,[&lt;STRONG&gt;__TotalCT&lt;/STRONG&gt; ])&lt;BR /&gt;RETURN&lt;BR /&gt;MAXX(FILTER(&lt;STRONG&gt;__Table&lt;/STRONG&gt; ,[&lt;STRONG&gt;__TotalCT&lt;/STRONG&gt; ]=&lt;STRONG&gt;__Max&lt;/STRONG&gt; ),[Process])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my logic (maybe wrong)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;__TotalCT &lt;/STRONG&gt;should be the MAX of [CT]&amp;nbsp; for each&amp;nbsp;[PROCESS] where&amp;nbsp;&amp;nbsp;[Product] is the same and&amp;nbsp; [MACH] is different&lt;/P&gt;&lt;P&gt;ej&lt;/P&gt;&lt;P&gt;&amp;nbsp; For Module A, the product has two sides, each run in different machines (SIDE 1 in Ln1 = 10 sec and SIDE 2 in Ln2=12). Since [MACH] are different the PROCESS output is 12 sec ( the machines can run at the same time, so the output will be based on the highest CT)&lt;/P&gt;&lt;P&gt;Once I have the Process CT, I need to compare with the rest of the PROCESS CT and the highest will be the constrain (in this case is FA=20)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that this make sense to you&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 17:34:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2100895#M47944</guid>
      <dc:creator>fzn4hs</dc:creator>
      <dc:date>2021-09-27T17:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Number of Rows based on multiple columns values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2101314#M47958</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="328344" data-lia-user-login="fzn4hs" class="lia-mention lia-mention-user"&gt;fzn4hs&lt;/a&gt;&amp;nbsp;I think I messed up and put the wrong column in for the summarize:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  // Assumes you have [Product] column in your visual
  VAR __Table = SUMMARIZE('Table',[Mach],"__TotalCT",SUM('Table'[CT])
  VAR __Max = MAXX(__Table,[__TotalCT])
RETURN
  MAXX(FILTER(__Table,[__TotalCT]=__Max),[Process])&lt;/LI-CODE&gt;
&lt;P&gt;Should be a summarize by Mach, not Process.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 21:43:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2101314#M47958</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-27T21:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Number of Rows based on multiple columns values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2106402#M48130</link>
      <description>&lt;P&gt;It does not recognize&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[__TotalCT]&lt;/LI-CODE&gt;&lt;P&gt;Is this another column that I need to calculate? Or should be calculated in the same measure?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 17:56:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2106402#M48130</guid>
      <dc:creator>fzn4hs</dc:creator>
      <dc:date>2021-09-29T17:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Number of Rows based on multiple columns values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2114987#M48451</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me to understand __TotalCT?&lt;/P&gt;&lt;P&gt;Than you!&lt;/P&gt;&lt;P&gt;JC&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 23:50:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-Rows-based-on-multiple-columns-values/m-p/2114987#M48451</guid>
      <dc:creator>fzn4hs</dc:creator>
      <dc:date>2021-10-04T23:50:56Z</dc:date>
    </item>
  </channel>
</rss>

