<?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: DAX command for filtering data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656549#M78557</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415705" data-lia-user-login="rodneicalcagnot" class="lia-mention lia-mention-user"&gt;rodneicalcagnot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is very helpful.&amp;nbsp; Thank you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple more q's:&lt;/P&gt;&lt;P&gt;1) There is one row WHERE Total = 2.&amp;nbsp; I believe this means we should treat the table as if there are &lt;EM&gt;actually two rows of (GL-04 &amp;amp; 01:19:00)&lt;/EM&gt;.&amp;nbsp; Is that right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) To identify the Top 10% (to be discarded), I first need a measure that calculates the total number of rows.&amp;nbsp; If my guess in question #1 above is correct, the total number of&amp;nbsp;&lt;EM&gt;visible&lt;/EM&gt; rows in the screenshot should be 17 (and not 16).&amp;nbsp; Is that also correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Finally, how do you want the discard rounded (rounding up or down)?&lt;/P&gt;&lt;P&gt;- 10% of 17 = 1.7.&amp;nbsp; Does this mean you want the TOP 2 records discarded out of 17? Or should only 1 record be discarded out of 17?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 21:34:35 GMT</pubDate>
    <dc:creator>WinterMist</dc:creator>
    <dc:date>2022-07-22T21:34:35Z</dc:date>
    <item>
      <title>DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2654143#M78344</link>
      <description>&lt;P&gt;I have a table with a column containing time intervals. I have nearly 1000 records on this table, and I need to calculate the average time interval, discarding the 10% longer intervals. How can I filter this? Is there a DAX command I can use for that?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 19:23:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2654143#M78344</guid>
      <dc:creator>rodneicalcagnot</dc:creator>
      <dc:date>2022-07-21T19:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2654192#M78349</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415705" data-lia-user-login="rodneicalcagnot" class="lia-mention lia-mention-user"&gt;rodneicalcagnot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Are you able to provide a screenshot of what some of the values are for this time interval column?&lt;/P&gt;&lt;P&gt;2) Would you also point out an example of a record which should be discarded due to "10% longer intervals".&amp;nbsp; I'm not yet understanding what this means.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 20:18:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2654192#M78349</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-07-21T20:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656294#M78522</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help, Nathan!&lt;/P&gt;&lt;P&gt;This table shows how long some service vehicles took to respond to incidents. I need to discard the 10% longest times (1:54 is the longest, on this case), and calculate the average response time of the other 90%.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 17:38:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656294#M78522</guid>
      <dc:creator>rodneicalcagnot</dc:creator>
      <dc:date>2022-07-22T17:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656549#M78557</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415705" data-lia-user-login="rodneicalcagnot" class="lia-mention lia-mention-user"&gt;rodneicalcagnot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is very helpful.&amp;nbsp; Thank you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple more q's:&lt;/P&gt;&lt;P&gt;1) There is one row WHERE Total = 2.&amp;nbsp; I believe this means we should treat the table as if there are &lt;EM&gt;actually two rows of (GL-04 &amp;amp; 01:19:00)&lt;/EM&gt;.&amp;nbsp; Is that right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) To identify the Top 10% (to be discarded), I first need a measure that calculates the total number of rows.&amp;nbsp; If my guess in question #1 above is correct, the total number of&amp;nbsp;&lt;EM&gt;visible&lt;/EM&gt; rows in the screenshot should be 17 (and not 16).&amp;nbsp; Is that also correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Finally, how do you want the discard rounded (rounding up or down)?&lt;/P&gt;&lt;P&gt;- 10% of 17 = 1.7.&amp;nbsp; Does this mean you want the TOP 2 records discarded out of 17? Or should only 1 record be discarded out of 17?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 21:34:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656549#M78557</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-07-22T21:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656624#M78561</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415705" data-lia-user-login="rodneicalcagnot" class="lia-mention lia-mention-user"&gt;rodneicalcagnot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK.&amp;nbsp; I'm close to the finish line, but not quite there (assuming my guesses are correct).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Create a measure to calculate the number of rows to discard.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Create a New Table of the Rows to Discard.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Create a New Table of the Rows to Keep.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) Create a measure which calculates the &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;weighted&lt;/STRONG&gt; &lt;/U&gt;&lt;/EM&gt;average (remembering 1:19:00 counts TWICE for Row 7) of 'Rows To Keep'[Time].&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- I haven't figured this out yet.&amp;nbsp; I thought this would be simple.&amp;nbsp; However, working with the HH:MM:SS format is giving me bizarre results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope what I have so far is helpful to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll update you when I figure out Step 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jul 2022 00:16:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2656624#M78561</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-07-23T00:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2660194#M78833</link>
      <description>&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/415705" target="_blank" rel="noopener"&gt;@rodneicalcagnot&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Wow.&amp;nbsp; This was much more challenging than I thought.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I just learned the following from Greg Deckler here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;DAX &amp;amp; Excel have no true time duration data type!&lt;/STRONG&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;&lt;STRONG&gt;- That's why performing aggregate functions on HH:MM:SS data does NOT work.&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So after performing the first 3 steps in the post above, Step 4 has the below sub-steps.&amp;nbsp; You can probably combine some of my steps, but I left them all in to show the thought process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4A) Manually calculate the average &lt;EM&gt;weighted&lt;/EM&gt; time in Excel, which is:&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;4,732 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- OR &lt;STRONG&gt;01:18:52&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;These are the answers to which we will compare our DAX calculations at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Remember that Row 7 counts twice&amp;nbsp;@ 1:19:00, which makes a total row count of 15.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4B) Create a Calculated Column in the 'Rows To Keep' table for [Seconds].&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4C)&amp;nbsp;Create a Calculated Column in the 'Rows To Keep' table for [Seconds Weighted].&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4D) Create a measure to calculate [Avg Time in SECONDS].&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: As you will see in the results screenshot below, this measure is a perfect match for our manually calculated number of seconds, 4732.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4E) Create a measure to convert from [Avg Time in Seconds] back into [Avg Time in HH:MM:SS].&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: As you will see in the results screenshot below, the final DAX calculation is not 01:18:52, but rather 01:18:01.&amp;nbsp; I believe this has to do with the differences between:&lt;/P&gt;&lt;P&gt;- DIVIDE function&lt;/P&gt;&lt;P&gt;- MOD function&lt;/P&gt;&lt;P&gt;- / operator&lt;/P&gt;&lt;P&gt;I messed with this final formula for a while, trying variations of the above 3 options, but the closest I could get was 20 seconds from 01:18:52.&amp;nbsp; Hoping you can get this last formula to your satisfaction of seconds.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, since DAX &amp;amp; Excel do not support a true duration data type, we have to workaround this by converting to seconds, performing the calculation, &amp;amp; then converting back again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this is helpful to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 20:37:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2660194#M78833</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-07-25T20:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2660219#M78837</link>
      <description>&lt;P&gt;Thank you so much for your help!&lt;/P&gt;&lt;P&gt;Your solution is exactly what I was looking for, and also gave me some really good ideas to improve my dashboards.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rodnei&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 20:45:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2660219#M78837</guid>
      <dc:creator>rodneicalcagnot</dc:creator>
      <dc:date>2022-07-25T20:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command for filtering data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2660232#M78840</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415705" data-lia-user-login="rodneicalcagnot" class="lia-mention lia-mention-user"&gt;rodneicalcagnot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are very welcome!&amp;nbsp; So glad I could help you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take care,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 21:00:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-for-filtering-data/m-p/2660232#M78840</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-07-25T21:00:00Z</dc:date>
    </item>
  </channel>
</rss>

