<?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: Calculated Column for Hierarchical Filtering in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712732#M82466</link>
    <description>&lt;P&gt;Can you assist with what measure would create this?&amp;nbsp; I'm not sure how I can create a measure that calculates the difference between other rows and then averages it.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Aug 2022 13:53:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-08-19T13:53:21Z</dc:date>
    <item>
      <title>Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2707644#M82158</link>
      <description>&lt;P&gt;I'm attempting to calculate the mean time between events with my data.&amp;nbsp; One aspect of doing this is calculating the difference in time between one event and the next, and having that input as a calculated column.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Uptime = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;next&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Report&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Report[Location]&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;Report[Location]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;Report[Reported Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;EARLIER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Report[Reported Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Report[Work Type]&lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt;"UM"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Report[Work Type]&lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt;"CM"&lt;/SPAN&gt;&lt;SPAN&gt;)), &lt;/SPAN&gt;&lt;SPAN&gt;Report[Reported Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Work Type]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"PM"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;next&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Reported Date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NOW&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;SECOND&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Reported Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;next&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SECOND&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The issue is that "Location" is a single column and I need this column to work with a hierarchy so that I can dive down in my report and look at the "mean time between events" as mean time in the main system, subsystem, etc. essentially diving through the hierarchy.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I think I would have to make some variable and reference that variable in my report but I'm not sure how to go about this.&amp;nbsp; This was the template I used -&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculate-Mean-Time-Before-Failure-MTBF-in-different-period-of/td-p/895369" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculate-Mean-Time-Before-Failure-MTBF-in-different-period-of/td-p/895369&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If I try to drill down in my current configuration, the "Main System" doesn't show the correct mean time between events - i.e. it might show 200 days between events when there are 20 events in its subsystem occurring in 20 days.&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Aug 2022 18:23:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2707644#M82158</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-17T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2711089#M82366</link>
      <description>&lt;LI-CODE lang="markup"&gt; I need this column to work with a hierarchy so that I can dive down in my report and look at the "mean time between events" as mean time in the main system, subsystem, etc. essentially diving through the hierarchy.&lt;/LI-CODE&gt;
&lt;P&gt;Calculated columns are immutable. They cannot be influenced by user interaction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use measures.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 23:06:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2711089#M82366</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-08-18T23:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712732#M82466</link>
      <description>&lt;P&gt;Can you assist with what measure would create this?&amp;nbsp; I'm not sure how I can create a measure that calculates the difference between other rows and then averages it.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 13:53:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712732#M82466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-19T13:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712800#M82469</link>
      <description>&lt;P&gt;Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.&lt;BR /&gt;Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. &lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 14:32:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712800#M82469</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-08-19T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712998#M82474</link>
      <description>&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event&lt;/TD&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;System&lt;/TD&gt;&lt;TD&gt;Date Reported&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Failure&lt;/TD&gt;&lt;TD&gt;Pump A&lt;/TD&gt;&lt;TD&gt;Boiler System&lt;/TD&gt;&lt;TD&gt;5/10/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Failure&lt;/TD&gt;&lt;TD&gt;Pump B&lt;/TD&gt;&lt;TD&gt;Boiler System&lt;/TD&gt;&lt;TD&gt;5/21/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Failure&lt;/TD&gt;&lt;TD&gt;Pump A&lt;/TD&gt;&lt;TD&gt;Boiler System&lt;/TD&gt;&lt;TD&gt;6/10/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Failure&lt;/TD&gt;&lt;TD&gt;Pump C&lt;/TD&gt;&lt;TD&gt;Boiler System&lt;/TD&gt;&lt;TD&gt;6/11/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Failure&lt;/TD&gt;&lt;TD&gt;Pump D&lt;/TD&gt;&lt;TD&gt;Condensate System&lt;/TD&gt;&lt;TD&gt;7/5/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Failure&lt;/TD&gt;&lt;TD&gt;Pump E&lt;/TD&gt;&lt;TD&gt;Condensate System&lt;/TD&gt;&lt;TD&gt;7/10/2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given a table of Dates, Locations, and System I would like to create a graph that displays the mean time between events (failures) by system.&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;I would then like to drill through / filter this graph by system to display mean times between failures by Location.&amp;nbsp; In this instance drilling down "Boiler System".&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;I'm not sure there's any easy way to accomplish this without requiring two calculated columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Time Between Failure (System)&lt;/TD&gt;&lt;TD&gt;Time Between Failure (Location)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to create those calculated columns, but I'd like to be able to have those values change based on what is being filtered out.&amp;nbsp; I.E. the time between events would change if you're just looking at the time between events on "Pump A" vs. time between events on "Boiler System".&amp;nbsp; Since calculated columns are immutable I'm not sure how to achieve this.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:51:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2712998#M82474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-19T15:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2713229#M82483</link>
      <description>&lt;P&gt;Thank you for the nice challenge.&amp;nbsp; Here is a universal measure that will work for all dimensions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTBF := 
var a = values(Failures[Date Reported])
var b = ADDCOLUMNS(a,"Previous",var t = [Date Reported] return CALCULATE(max(Failures[Date Reported]),Failures[Date Reported]&amp;lt;t))
var c = filter(b,not ISBLANK([Previous]))
return AVERAGEX(c,[Date Reported]-[Previous])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see attached.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 17:35:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2713229#M82483</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-08-19T17:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2718371#M82804</link>
      <description>&lt;P&gt;Very impressive!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't yet tested it with every use case but this did the trick for me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on your experience (since I believe with large data measures are usually avoided due to time requirements) is there a way to perform something like this in Power Query?&amp;nbsp; Or a more optimal way of doing this?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 21:51:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2718371#M82804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-22T21:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for Hierarchical Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2718397#M82805</link>
      <description>&lt;P&gt;You can do this in Power Query or as a calculated column.&amp;nbsp; I don't think the performance will be much better, and you lose all the flexibility that you seem to want with your hierarchy etc. If you want flexibility you need to use measures.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 21:53:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-Hierarchical-Filtering/m-p/2718397#M82805</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-08-22T21:53:50Z</dc:date>
    </item>
  </channel>
</rss>

