skip to main content
Power BI
    • What is Power BI
    • Why Power BI
    • Customer stories
    • Data visuals
    • Security
    • Power BI Desktop
    • Power BI Pro
    • Power BI Premium
    • Power BI Mobile
    • Power BI Embedded
    • Power BI Report Server
  • Pricing
    • Azure + Power BI
    • Microsoft 365 + Power BI
    • Dynamics 365 + Power BI
      • Energy
      • Healthcare
      • Manufacturing
      • Media
      • Retail
    • For analysts
    • For IT
      • Overview
      • Embedded analytics
      • Power BI visuals
      • Automation
      • Documentation
      • Community
    • Overview
    • Find consulting services
    • Partner showcase
    • Find a partner
    • Become a partner
    • Instructor-led training
    • Getting started
      • Overview
      • Online workshops
      • Self-guided learning
      • Webinars
      • Documentation
      • Roadmap
      • Overview
      • Issues
      • Give feedback
    • Blog
    • Business intelligence topics
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Events
    • User groups
    • Community blog
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Galleries
    • Community Connections & How-To Videos
    • COVID-19 Data Stories Gallery
    • Themes Gallery
    • Data Stories Gallery
    • R Script Showcase
    • Webinars and Video Gallery
    • Quick Measures Gallery
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Events
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power BI Community
    • Galleries
    • Quick Measures Gallery
    • Re: Mean Time Between Failure (MTBF)

    Re: Mean Time Between Failure (MTBF)

    04-15-2020 23:23 PM

    Anonymous
    Not applicable
    4459 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Mean Time Between Failure (MTBF)

    ‎02-16-2019 08:39 AM

    This Quick Measure is an update to my Mean Time Between Failure (MTBF) measure that I developed in this article:

    https://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339...

     

    The original method had some significant column-based elements and my goal was to make this measure truly dynamic. A significant issue with the original approach is that when slicing by "Cause", the MTBF figure calculated was not truly dynamic by Cause of failure. In other words, the Uptime calculation did not account for only looking at particular causes, only between failures of the same machine. So, uptime calculated by considering all causes is vastly different than when only looking at a particular cause. 

     

    This measure corrects that flaw, although I have also included a version of the measure that does not need a calculated column but calculates uptime in the exact same way as in the aforementioned article. The new measures are down in the bottom, right-hand corner. You will notice that the new fully dynamic measure is much larger when selecting a Cause. This is because the MTBF calculation is only considering the MTBF for that particular cause.

     

     

    MTBF (Hours) Measure = 
    VAR __table = 'Repairs'
    VAR __table1 = 
                ADDCOLUMNS(__table,"__next",
                    MINX(
                        FILTER(__table,
                                [MachineName]=EARLIER([MachineName]) && 
                                [RepairStarted]>EARLIER([RepairStarted]) && 
                                [RepairType]<>"PM"
                        ),
                        [RepairStarted]
                    )
                )
    VAR __table2 = ADDCOLUMNS(__table1,"__uptime",
                        IF([RepairType]="PM",
                            0,
                            IF(ISBLANK([__next]),
                                DATEDIFF([RepairCompleted],NOW(),SECOND),
                                DATEDIFF([RepairCompleted],[__next],SECOND)
                            )
                        )
                    )
    VAR __repairs = CALCULATE(COUNTROWS('Repairs'),FILTER(ALLSELECTED('Repairs'),[RepairType]<>"PM"))
    RETURN
    DIVIDE(SUMX(__table2,[__uptime]),__repairs,BLANK())/3600

     

     

    eyJrIjoiZmFjYTQwYjMtMGJlOS00Mjk4LTlkM2QtNmQ2NTc4MmU4YjAwIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Preview file
    16 KB
    MTBF.pbix
    Labels:
    • Labels:
    • Mathematical
    • Other
    • Totals
    Message 1 of 5
    6,455 Views
    0
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-15-2020 11:23 PM

    Hi @Greg_Deckler, 

     

    Thanks for the awesome post. 

    However, with the previous calculated column for uptime, MTBF measure can be filter by period. Let's say for example, I don't want machine7 MTBF for the whole period, I just want machine7 MTBF for a particular peiord only. How can I tweak your codes to suit my needs?

    Also, is it possible to get separate measure for just Uptime, which is the same as Uptime calculated column?

    Message 3 of 5
    4,459 Views
    0
    Reply
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    In response to Anonymous
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-16-2020 06:37 AM

    Should be possible, would need more information. Definitely been through a lot of edits with this one, the best version is in my book which fixed a bunch of bugs and other little things that I found annoying. I can reference that version but I believe some of the fixes were related to being able to properly slice the metric by things like date ranges, etc.


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Message 4 of 5
    4,449 Views
    0
    Reply
    Anonymous
    Not applicable
    In response to Greg_Deckler
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-16-2020 06:38 PM

    Hi @Greg_Deckler 

     

    Thanks for the reply. Please find the sample attached. 

    You are right, 

    • MTBF measure is dynamic (react to particular causes) but not to date ranges.
    • The original MTBF is based on calculated column of uptime, not dynamic (doesn't react to particular causes) but respond to date ranges. 
    • I am assuming MTBF measure1 is similar to original one? It responds to date ranges but I don't get the same value as original MTBF. 

    I think my issue could be solved if I can create a separate uptime measure (the one I created is not right?).

     

    Another separate issue in my data is eliminating multiple alarms. My data source is the daily csv logs which contain thousands of events. Some sites' event duration last more than a day (>24hr) but they are captured as separate entry in the next-day csv logs. I kind of manage to eliminate those events (via Critical Alarm v2) but I am not sure that is fail safe outside of this sample data. 

    There are also dummy events (downtime 0hr) which I'd like to eliminate as well. Eliminating them would reduce the total critical alarm, which is vital in calculating correct mtbf and availability. 

     

     

    sample.pbix
    Message 5 of 5
    4,421 Views
    0
    Reply
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎10-02-2019 01:08 PM

    Im struggling with some points:

    • What about visualizing the MTBF during days, weeks or months? I mean, to check out if the value is correct, I would like to filter it by day, check the calculations by hand and then comparing it with the measure, but the values are very wierd. How could w solve that? What about a visual showing how the MTBF is developing?

     

    I really need this and your post is the only one I found that gets closer to my issue.

     

    Thanks,

    Message 2 of 5
    5,450 Views
    0
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign in
    • Sign up

    Browse

    • Solutions
    • Partners
    • Consulting Services

    Downloads

    • Power BI Desktop
    • Power BI Mobile
    • Power BI Report Server
    • See all downloads

    Learn

    • Guided learning
    • Documentation
    • Support
    • Community
    • Give feedback
    • Webinars
    • Developers
    • Blog
    • Newsletter

    © 2023 Microsoft

    Follow Power BI

    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices