Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |