Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
lukachko
New Member

using the sum of a column in all records as

Good afternoon,


Im struggling to calculate and hold values in a table to calculate a percentage of downtime.

We have a table that contains records of a manufacturing machine state. one thing we are measuring is downtime. We have records of events of when a machine is down, why its down and for how long the machine is down for. This part of the calculation is pretty straight forward in a measure. The issue I have is trying to determine what the total availible time is.

I need to take the Sum total of the value (unplanned) for all records By "Date"(datetime) and by "shift" (numeric) . I am struggling to do this, I have tried to use combinations of Calculate,SUM and SUMX. I'm kind of stuck now.

The example is the following columns in the table. Availible time is how many minutes is availible by that work centre uninterrupted.
ALL_Unplanned downtime is the individual records unplanned downtime.
Actual time is what Im trying to calculate, the value I'm getting, vs the Value on the right (MANUAL CALC real actual)

I have solved this issue in the past by transposing the table but its definately not the right way to do it.
I also hope I don't need to build summary tables because we want to be able to filter and drill data in the BI report. 

WKCDescShiftDowntimeDowntimeDescElapsedMinutesAvailibleTimeAll_UnplannedactualTimeMANUAL CALC real actual
37643764 - T1XX LH362Welder14.7548015465.25309
37643764 - T1XX LH376Light-Up7.654808472.35309
37643764 - T1XX LH382BREAK38.18333333333334480 480309
37643764 - T1XX LH384Vision Issue6.0833333333333334806473.9166666666667309
37643764 - T1XX LH386Driver Issue31.06666666666666648031448.93333333333334309
37643764 - T1XX LH391Robot110.93333333333334480111369.06666666666666309
37643764 - T1XX LH488Technical Troubleshooting466.9333333333333448046713.06666666666666314
37643764 - T1XX LH4113Masters9.016666666666667480 480 



1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @lukachko  - I have created actual time values by using the below fields, please check and let know.

 

rajendraongole1_0-1738685109627.png

 

Please find the attached pbix file. 

I hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
lukachko
New Member

Thanks for the solution. 

I got a little bit more fancy using summerize() and a related table to get my data lined up better.

v-heq-msft
Community Support
Community Support

Hi @lukachko ,
Does their answer solve your problem, if yes, you can mark their answer as a solution so that users with similar problems can find the solution faster, if not, you can continue to ask your question below.

 

Best regards,
Albert He

rohit1991
Super User
Super User

Hi @lukachko ,

You need to calculate Actual Time as:

Available Time - Sum of Unplanned Downtime for each Date & Shift

DAX Measure for Actual Time

ActualTime =
VAR TotalUnplanned =
    CALCULATE(
        SUM('Table'[All_Unplanned]),
        ALLEXCEPT('Table', 'Table'[Shift], 'Table'[Date])
    )
RETURN
MAX('Table'[AvailibleTime]) - TotalUnplanned

 

Explanation:

  1. SUM('Table'[All_Unplanned]) → Sums unplanned downtime.
  2. ALLEXCEPT('Table', 'Table'[Shift], 'Table'[Date]) → Keeps only the current Shift & Date while summing.
  3. MAX('Table'[AvailibleTime]) → Ensures available time remains constant.

 

"The goal is to turn data into information, and information into insight." – Carly Fiorina

Need Power BI help? Connect on LinkedIn.

 

 

rajendraongole1
Super User
Super User

Hi @lukachko  - I have created actual time values by using the below fields, please check and let know.

 

rajendraongole1_0-1738685109627.png

 

Please find the attached pbix file. 

I hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.