I have built a new measure to calculate YTD SLA using the below DAX:
SLA YTD = TOTALYTD((ABS(AVERAGE('Final Product Data_New'[Availability])),'Final Product Data_New'[All_Data.ort_start_date].[Date])
however the SLA score that is shown iin the visual using the above DAX does not match the manula calculation.
E.G: Product A has total outage minutes of 1140 from 1st Jan till date. Considering till 18th March we have 77 days for the YTD calculation. Below is the manula calculation and the score shown in the visual:
(no. of days X 1440 minutes - outage minutes)/total number of minutes x 100
(77 x 1440)-1140/77 x 1440) x 100
= (110880-1140/110880) x 100
= (109740/110880) x 100
= 98.97 % and the calculation in the visual is 91.40%.
Please suggest.
4 Comments
- v-chuncz-msftCommunity Support
It seems that you'll need to add DIVIDE to perform division.
- https://community.powerbi.com/t5/Desktop/Conditional-formatting-on-boolean-values-filtered-by-multiple/m-p/688076#M331678
- https://community.powerbi.com/t5/Desktop/SLA-calculation-by-month/m-p/578620#M273595
By the way, for any question about data shaping, modeling, and reportbuilding in the Power BI Desktop app, feel free to post a new message in Desktop forum.
- swaroopjkFrequent Visitor
Hi,
I missed to mention that the 'Final Product Data_New'[Availability]' is a calculated field and uses the below formula:
(no. of days X 1440 minutes - outage minutes)/total number of minutes x 100.
So the division is already happening. How do we give a date window? Does TotalYTD function calculated from 1st Jan 2021 till date?
Regards,
SK.
- v-chuncz-msftCommunity Support
AVERAGE is not proper here. You may take a look at https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/.
- swaroopjkFrequent Visitor
Hi,
I would need to count no. of days in year till date to calculate the YTD SLA Any ideas on how can I acheive that?
Regards,
SK.