<?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 dynamic median filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4323360#M171639</link>
    <description>&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are struggling to get a dynamic median filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see some sample data below:&lt;/P&gt;&lt;P&gt;The portion on the left in blue is the sample data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the right is some calculations we have done in powerbi.&lt;/P&gt;&lt;P&gt;We use the datadiff function to get the: Time to move states (time to new state and time to contacted state) as well as the Time currently still in new state (time to new state and Today); then we use the median and average functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to highlight the leads that are currently still in a new state but outside the median of those that already moved on.&lt;/P&gt;&lt;P&gt;So lead A should be highlighted because it is at 4.1 days which is greater than the median of 1.13 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this must all be dynamic as new leads will come in daily and change the overall median, plus if we want to filter for a certain period then the median must reflect that period.&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;end result is a simple card visual showing how many leads are in a New state and currently outside the median (1 in this case)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 08:45:13 GMT</pubDate>
    <dc:creator>SammyNed</dc:creator>
    <dc:date>2024-12-11T08:45:13Z</dc:date>
    <item>
      <title>dynamic median filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4323360#M171639</link>
      <description>&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are struggling to get a dynamic median filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see some sample data below:&lt;/P&gt;&lt;P&gt;The portion on the left in blue is the sample data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the right is some calculations we have done in powerbi.&lt;/P&gt;&lt;P&gt;We use the datadiff function to get the: Time to move states (time to new state and time to contacted state) as well as the Time currently still in new state (time to new state and Today); then we use the median and average functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to highlight the leads that are currently still in a new state but outside the median of those that already moved on.&lt;/P&gt;&lt;P&gt;So lead A should be highlighted because it is at 4.1 days which is greater than the median of 1.13 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this must all be dynamic as new leads will come in daily and change the overall median, plus if we want to filter for a certain period then the median must reflect that period.&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;end result is a simple card visual showing how many leads are in a New state and currently outside the median (1 in this case)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 08:45:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4323360#M171639</guid>
      <dc:creator>SammyNed</dc:creator>
      <dc:date>2024-12-11T08:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic median filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4324683#M171703</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 00:35:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4324683#M171703</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-12T00:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic median filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4324895#M171708</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312920" data-lia-user-login="SammyNed" class="lia-mention lia-mention-user"&gt;SammyNed&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I create a table as you mentioned.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then I create two calculated columns.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TimeToNewState = DATEDIFF([Time moved to New State], TODAY(), DAY)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;TimeToContactedState = DATEDIFF([Time moved to New State], [Time moved to Contacted State], DAY)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Next I think you can create two measures and a calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MedianTimeToContacted = MEDIANX(
    FILTER(
        'Table',
        NOT(ISBLANK([TimeToContactedState]))
    ),
    [TimeToContactedState]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;IsOutsideMedian = IF(
    AND(
        [Current State] = "New",
        [TimeToNewState] &amp;gt; [MedianTimeToContacted]
    ),
    1,
    0
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LeadsOutsideMedian = CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        [IsOutsideMedian] = 1
    )
)&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 03:07:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/dynamic-median-filter/m-p/4324895#M171708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T03:07:53Z</dc:date>
    </item>
  </channel>
</rss>

