<?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: Calculating availability in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765888#M85899</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="441379" data-lia-user-login="Azucrinador" class="lia-mention lia-mention-user"&gt;Azucrinador&lt;/a&gt; , &lt;/P&gt;
&lt;P&gt;In any Date you can add minutes like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Date] + Time(0,[Minutes column], 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but can you explain this&lt;/P&gt;
&lt;P&gt;Is there any way I can get the sum of the running time (in minutes), deduct the accordingly month time (in minutes) and divide by it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case you days in month&lt;/P&gt;
&lt;P&gt;day(eomonth([Date],0))&amp;nbsp; will give last day of month&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 03:17:09 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-09-14T03:17:09Z</dc:date>
    <item>
      <title>Calculating availability</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765261#M85869</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;I'm trying to calculate the availability of service on DAX, I was able to do it by adding the running time (minutes), deducting 43200 and dividing by 43200 (30 days). It gives me the availability for 30 days only.&lt;BR /&gt;&lt;BR /&gt;What I need is to be able to calculate the availability monthly, as example.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;February has 28 days, so it would be running time -40320/4320.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is there any way I can get the sum of the running time (in minutes), deduct the accordingly month time (in minutes) and divide by it?&lt;BR /&gt;Or if you have any other way to calculate the service availability based on the monthly time (in minutes).&lt;BR /&gt;&lt;BR /&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 19:48:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765261#M85869</guid>
      <dc:creator>Azucrinador</dc:creator>
      <dc:date>2022-09-13T19:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating availability</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765883#M85898</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="441379" data-lia-user-login="Azucrinador" class="lia-mention lia-mention-user"&gt;Azucrinador&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can refer the following links to get it:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.bmc.com/blogs/service-availability-calculation-metrics/" target="_self"&gt;Service Availability: Calculations and Metrics, Five 9s, and Best Practices&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Service/Calculating-Availability-duration-as-a-percentage-of-time-range/m-p/597610" target="_self"&gt;&lt;SPAN&gt;Calculating Availability (duration as a percentage of time range)&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;date range =
VAR startdate =
    MIN ( 'Date'[Date] )
VAR enddate =
    MAX ( 'Date'[Date] )
RETURN
    DATEDIFF ( startdate, enddate, DAY ) + 1

percentage =
VAR startdate =
    MIN ( 'Date'[Date] )
VAR enddate =
    MAX ( 'Date'[Date] )
VAR lostdate =
    SELECTEDVALUE ( data[lostservice] )
VAR regaineddate =
    SELECTEDVALUE ( data[regainedservice] )
RETURN
    IF (
        lostdate &amp;gt;= startdate
            &amp;amp;&amp;amp; regaineddate &amp;lt;= enddate,
        DATEDIFF ( lostdate, regaineddate, DAY ),
        IF (
            lostdate &amp;gt;= startdate
                &amp;amp;&amp;amp; lostdate &amp;lt;= enddate
                &amp;amp;&amp;amp; regaineddate &amp;gt;= enddate,
            DATEDIFF ( lostdate, enddate, DAY ),
            IF (
                lostdate &amp;lt; startdate
                    &amp;amp;&amp;amp; regaineddate &amp;lt;= enddate
                    &amp;amp;&amp;amp; regaineddate &amp;gt;= startdate,
                DATEDIFF ( startdate, regaineddate, DAY ),
                IF (
                    lostdate &amp;lt; startdate
                        &amp;amp;&amp;amp; regaineddate &amp;gt; enddate,
                    DATEDIFF ( startdate, enddate, DAY ),
                    BLANK ()
                )
            )
        )
    )
        / [date range]&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;&lt;I&gt;exclude&amp;nbsp;&lt;/I&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;sensitive&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;I&gt;data&lt;/I&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;Text&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;It is better&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;simplified&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 03:14:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765883#M85898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-14T03:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating availability</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765888#M85899</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="441379" data-lia-user-login="Azucrinador" class="lia-mention lia-mention-user"&gt;Azucrinador&lt;/a&gt; , &lt;/P&gt;
&lt;P&gt;In any Date you can add minutes like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Date] + Time(0,[Minutes column], 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but can you explain this&lt;/P&gt;
&lt;P&gt;Is there any way I can get the sum of the running time (in minutes), deduct the accordingly month time (in minutes) and divide by it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case you days in month&lt;/P&gt;
&lt;P&gt;day(eomonth([Date],0))&amp;nbsp; will give last day of month&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 03:17:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2765888#M85899</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-14T03:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating availability</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2767937#M86036</link>
      <description>&lt;P&gt;Hi Amitchandak, thank you for the reply, here is a sample of what I've already done which gives me the availability time within 30 days,&lt;BR /&gt;&lt;BR /&gt;Here is the formula used "&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;SLA = ((&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Enel&lt;/SPAN&gt;&lt;SPAN&gt;[TEMPO ABERTO]&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;43200&lt;/SPAN&gt;&lt;SPAN&gt;)/&lt;/SPAN&gt;&lt;SPAN&gt;43200&lt;/SPAN&gt;&lt;SPAN&gt;)*-&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;1" Tempo aberto = The period the service was having a failure.&lt;BR /&gt;&lt;BR /&gt;In my case, we assume that the service should be running 24/7, and we deduct the time it had a failure (in minutes) to get the service availability, example below:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;This is the information I get by using the formula, which gives me the availability for 30 days, but I need to be able to make it calculate month by month, like, February has 28 days, so the availability will be calculated in this period.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can it be done in a single formula?&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:52:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2767937#M86036</guid>
      <dc:creator>Azucrinador</dc:creator>
      <dc:date>2022-09-14T16:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating availability</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2767943#M86037</link>
      <description>&lt;P&gt;Hi Rena, good afternoon! Thank you for the reply, here is a sample of what I've already done which gives me the availability time within 30 days,&lt;BR /&gt;&lt;BR /&gt;In your case above you use the difference between 2 dates to calculate the availability, right? In my case, the date where the service was recovered is not the correct information, needing to be calculated with the "tempo aberto" which is the period the service was off.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the formula used "&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;SLA = ((&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Enel&lt;/SPAN&gt;&lt;SPAN&gt;[TEMPO ABERTO]&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;43200&lt;/SPAN&gt;&lt;SPAN&gt;)/&lt;/SPAN&gt;&lt;SPAN&gt;43200&lt;/SPAN&gt;&lt;SPAN&gt;)*-&lt;/SPAN&gt;&lt;SPAN&gt;1" Tempo aberto = The period the service was having a failure.&lt;BR /&gt;&lt;BR /&gt;In my case, we assume that the service should be running 24/7, and we deduct the time it had a failure (in minutes) to get the service availability, example below:&lt;BR /&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;This is the information I get by using the formula, which gives me the availability for 30 days, but I need to be able to make it calculate month by month, like, February has 28 days, so the availability will be calculated in this period.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can it be done in a single formula?&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:54:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-availability/m-p/2767943#M86037</guid>
      <dc:creator>Azucrinador</dc:creator>
      <dc:date>2022-09-14T16:54:57Z</dc:date>
    </item>
  </channel>
</rss>

