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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pak
Helper II
Helper II

Calculate Performance by group (machine)

Hello,

 

I want to calulate performance for machines. I got this data:

TimeMachineQuantityWorkTimePlanned1PcTime
2020-04-28 16:16:08MACHINE-10048
2020-04-28 16:16:08MACHINE-20060
2020-04-28 16:16:08MACHINE-30020
2020-04-28 16:16:08MACHINE-40090
2020-04-28 16:16:39MACHINE-100.448
2020-04-28 16:16:39MACHINE-202.660
2020-04-28 16:16:39MACHINE-30220
2020-04-28 16:16:39MACHINE-401.290
2020-04-28 16:17:09MACHINE-1030.248
2020-04-28 16:17:09MACHINE-2030.260
2020-04-28 16:17:09MACHINE-302020
2020-04-28 16:17:09MACHINE-4030.290
2020-04-28 16:17:40MACHINE-1030.248
2020-04-28 16:17:40MACHINE-2030.260
2020-04-28 16:17:40MACHINE-3116.220
2020-04-28 16:17:40MACHINE-4030.290
2020-04-28 16:18:11MACHINE-1030.248
2020-04-28 16:18:11MACHINE-212460
2020-04-28 16:18:11MACHINE-305.820
2020-04-28 16:18:11MACHINE-4121.290
2020-04-28 16:18:41MACHINE-1117.648
2020-04-28 16:18:41MACHINE-2030.260
2020-04-28 16:18:41MACHINE-302220
2020-04-28 16:18:41MACHINE-4030.290
2020-04-28 16:19:12MACHINE-1030.248
2020-04-28 16:19:12MACHINE-2014.460
2020-04-28 16:19:12MACHINE-312220
2020-04-28 16:19:12MACHINE-4030.290
2020-04-28 16:19:43MACHINE-1030.248
2020-04-28 16:19:43MACHINE-212160
2020-04-28 16:19:43MACHINE-3113.620
2020-04-28 16:19:43MACHINE-4030.290
2020-04-28 16:20:13MACHINE-1020.248
2020-04-28 16:20:13MACHINE-2030.260
2020-04-28 16:20:13MACHINE-3116.620
2020-04-28 16:20:13MACHINE-4030.290
2020-04-28 16:20:44MACHINE-1129.248
2020-04-28 16:20:44MACHINE-2117.460
2020-04-28 16:20:44MACHINE-3013.820
2020-04-28 16:20:44MACHINE-4123.890
2020-04-28 16:21:15MACHINE-1030.248
2020-04-28 16:21:15MACHINE-2030.260
2020-04-28 16:21:15MACHINE-312220
2020-04-28 16:21:15MACHINE-4030.290
2020-04-28 16:21:45MACHINE-1030.248
2020-04-28 16:21:45MACHINE-2030.260
2020-04-28 16:21:45MACHINE-317.820
2020-04-28 16:21:45MACHINE-4030.290

 

It's ok when filter is set to one of the machines. But when i want to see performance for all machines, it's wrong, because Planned1PcTime is different for every machine. It should count performance for each meachine and then count average for those machines performance - in this case: sum of average performance for every machine (seperately) devide by 4(machines). I want to shaw data in line chart in time bins (for this example 2 minutes).
I've tried many ways mentioned in other posts but nothing works correctly.

I'm sending data from devices every 15 secounds.
General formula for performance is:

 

 

 

PerformanceAVG = (SUM(Table[Quantity])*AVERAGE(Table[Planned1PcTime]))/SUM(Table[WorkTime])

 

 

 

 

Overall:

Machine-1 Performance = 34,43%

Machine-2 Performance = 69,07%

Machine-3 Performance = 74,17%

Machine-4 Performance = 62,54%

Performance for all machines should be 60,05% NOT 71,64%.

 

I'll be gratefull for any help 🙂

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @pak 

 

Try this 

Measure = 
AVERAGEX(
    VALUES( 'Table'[Machine] ),
    CALCULATE(
        DIVIDE( 
            SUMX( 
                'Table', 
                'Table'[Quantity] * 'Table'[Planned1PcTime] 
            ),
            SUM( 'Table'[WorkTime] )
        )
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @pak 

 

Try this 

Measure = 
AVERAGEX(
    VALUES( 'Table'[Machine] ),
    CALCULATE(
        DIVIDE( 
            SUMX( 
                'Table', 
                'Table'[Quantity] * 'Table'[Planned1PcTime] 
            ),
            SUM( 'Table'[WorkTime] )
        )
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Works great. Thanks!

Mariusz
Community Champion
Community Champion

Hi @pak 

 

Glad I could help!

 

 

Best Regards,
Mariusz

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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