Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hello,
I want to calculate the total Up Time on the basis of "Hours Of Operational Use". I have written the below DAX measure for the same.
Solved! Go to Solution.
Thanks @tamerj1 for your time and effort to get this calculation correct.
What I discovered later is that the problem was not with the DAX witten by me. I was making use of column 'Hours of Operational Use' from wrong table which was causing this problem. After changing the table, the same DAX started giving the correct output. Please see below snapshot.
But I must admit that your modified DAX version is simple and easy to understand.
Thanks Again for your quick help. Much appreciated. Cheers.
HI @vishu263
Apparently you have created a calculated column instead of a measure. Just use the same DAX in a measure and it should wok. However, here is an improved version of the DAX
vTotalUptime =
VAR Days = [vTotalDaysInPeriod]
VAR BusinessDays = [vBusinessDaysInPeriod]
RETURN
SUMX (
VALUES ( 'Service Availability'[Hours Of Operational Use] ),
SWITCH (
'Service Availability'[Hours Of Operational Use],
"24x7",
Days * 24 * 60,
"Business Hours",
BusinessDays * 9 * 60,
"Extended Hours - 7 days",
Days * 13 * 60,
"Extended Hours - 5 days",
BusinessDays * 13 * 60
)
)
Make sure [vTotalDaysInPeriod] and [vTotalDaysInPeriod] are also measures not calculated columns. Please let me know if they are in fact columns in the source data table.
Thanks @tamerj1 for your time and effort to get this calculation correct.
What I discovered later is that the problem was not with the DAX witten by me. I was making use of column 'Hours of Operational Use' from wrong table which was causing this problem. After changing the table, the same DAX started giving the correct output. Please see below snapshot.
But I must admit that your modified DAX version is simple and easy to understand.
Thanks Again for your quick help. Much appreciated. Cheers.
Hi @vishu263 your measure vTotalUptime, could be as shown belos adjust Sheet3 to your table name
Proud to be a Super User!
Thanks @some_bih for your time and effort to get this calculation correct. I am sure the above calculation will give the desired output.
What I discovered later is that I was making use of column 'Hours of Operational Use' from wrong table which was causing this problem. After changing the table, the same DAX started giving the correct output.
Thanks Again.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!