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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
EricoVincentciu
Helper II
Helper II

please help to get active time on power bi

hello i wanna make total average base on dept and distinct by internal id 

 

for example when i choose dept

FM-GA
FM-SBB
FM-WHCH

 

 

 i got (50 vehicle) dynamic 

if i choose another dept for example 

FG-WH

I got 27 Dynamic


and i wanna count Total hour divide total vehicle base on dept 

in excel i got formula like this : 

- Step one 

 

EricoVincentciu_0-1724920150840.png

 

sum total hour active 

 

- step two

 

EricoVincentciu_1-1724920222248.png

sum of total divide vehicle 

- Step 3 

 

EricoVincentciu_2-1724920284887.png

result divide 528

 

528 is a range between 6 aug until 27 aug multiply ( * ) 24 hour

 

 

EricoVincentciu_3-1724920425535.png

 

Last Convert to percentage

 

this is my raw master data at excel 

 

internal_idtypestatusunitoperational_datetime_starttime_finishdept_idmenitjam
DTOF000004OPERATIONALCMAIN06/08/202408:0515:35FM-GA0,317,50
DTOF000004OPERATIONALCMAIN06/08/202416:1023:25FM-GA0,307,25
DTOF000004OPERATIONALCMAIN07/08/202408:0515:20FM-GA0,307,25
DTOF000004OPERATIONALCMAIN07/08/202416:1523:30FM-GA0,307,25
DTOF000004OPERATIONALCMAIN08/08/202408:0513:45FM-GA0,245,67
DTOF000004OPERATIONALCMAIN08/08/202416:0523:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN09/08/202416:1523:30FM-GA0,307,25
DTOF000004OPERATIONALCMAIN10/08/202408:0515:20FM-GA0,307,25
DTOF000004OPERATIONALCMAIN10/08/202416:1023:30FM-GA0,317,33
DTOF000004OPERATIONALCMAIN11/08/202400:0507:25FM-GA0,317,33
DTOF000004OPERATIONALCMAIN11/08/202408:0515:26FM-GA0,317,35
DTOF000004OPERATIONALCMAIN12/08/202400:0507:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN12/08/202408:0515:40FM-GA0,327,58
DTOF000004OPERATIONALCMAIN12/08/202416:0523:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN13/08/202400:0507:35FM-GA0,317,50
DTOF000004OPERATIONALCMAIN13/08/202408:0515:35FM-GA0,317,50
DTOF000004OPERATIONALCMAIN13/08/202416:0823:30FM-GA0,317,37
DTOF000004OPERATIONALCMAIN14/08/202400:0507:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN14/08/202408:0515:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN14/08/202416:0523:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN15/08/202400:0507:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN15/08/202408:1015:30FM-GA0,317,33
DTOF000004OPERATIONALCMAIN15/08/202416:0723:20FM-GA0,307,22
DTOF000004OPERATIONALCMAIN16/08/202400:0505:45FM-GA0,245,67
DTOF000004OPERATIONALCMAIN16/08/202408:1515:25FM-GA0,307,17
DTOF000004OPERATIONALCMAIN16/08/202416:1523:30FM-GA0,307,25
DTOF000004OPERATIONALCMAIN17/08/202400:0507:30FM-GA0,317,42
DTOF000004OPERATIONALCMAIN17/08/202408:1515:25FM-GA0,307,17
DTOF000004OPERATIONALCMAIN18/08/202400:0507:35FM-GA0,317,50
DTOF000004OPERATIONALCMAIN18/08/202408:1013:35FM-GA0,235,42
DTOF000007OPERATIONALCMAIN06/08/202416:1023:30FM-GA0,317,33
DTOF000007OPERATIONALCMAIN07/08/202408:0515:20FM-GA0,307,25
DTOF000007OPERATIONALCMAIN07/08/202416:1523:32FM-GA0,307,28
DTOF000007OPERATIONALCMAIN08/08/202408:0515:30FM-GA0,317,42
DTOF000007OPERATIONALCMAIN08/08/202416:0323:25FM-GA0,317,37
DTOF000007OPERATIONALCMAIN09/08/202416:1023:25FM-GA0,307,25
DTOF000007OPERATIONALCMAIN10/08/202408:0515:20FM-GA0,307,25
DTOF000007OPERATIONALCMAIN10/08/202416:0521:55FM-GA0,245,83
DTOF000007OPERATIONALCMAIN11/08/202400:1307:23FM-GA0,307,17
DTOF000007OPERATIONALCMAIN11/08/202408:1015:20FM-GA0,307,17
DTOF000007OPERATIONALCMAIN12/08/202400:0507:30FM-GA0,317,42
DTOF000007OPERATIONALCMAIN12/08/202408:1014:00FM-GA0,245,83
DTOF000007OPERATIONALCMAIN13/08/202400:0505:40FM-GA0,235,58
DTOF000007OPERATIONALCMAIN13/08/202408:1015:35FM-GA0,317,42
DTOF000007OPERATIONALCMAIN14/08/202408:0513:15FM-GA0,225,17

 

i wanna make uttilization base on this table on power bi 

if i import file excel to power bi, this data will be  static, so i select data base on server (until current time)

 

 

please help to get active time on power bi

 

file powerbi and excel complete

 

@OwenAuger 
@bhanu_gautam 
@sjoerdvn 
@Jihwan_Kim 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @EricoVincentciu 

 

Based on the data you have provided, please see if this is your desired outcome.

Measure1 = CALCULATE(SUM('Table'[jam]),ALLEXCEPT('Table','Table'[internal_id]))
Measure2 = CALCULATE(COUNT('Table'[internal_id]),ALLEXCEPT('Table','Table'[internal_id]))
Measure3 = DIVIDE([Measure1],[Measure2])
Datediff = 
Var _date1=CALCULATE(MIN('Table'[operational_date]),ALLEXCEPT('Table','Table'[internal_id]))
Var _date2=CALCULATE(MAX('Table'[operational_date]),ALLEXCEPT('Table','Table'[internal_id]))
RETURN
DATEDIFF(_date1,_date2+1,HOUR)
Result = DIVIDE([Measure3],[Datediff])

vzhangtinmsft_0-1725257093285.png

Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @EricoVincentciu 

 

Based on the data you have provided, please see if this is your desired outcome.

Measure1 = CALCULATE(SUM('Table'[jam]),ALLEXCEPT('Table','Table'[internal_id]))
Measure2 = CALCULATE(COUNT('Table'[internal_id]),ALLEXCEPT('Table','Table'[internal_id]))
Measure3 = DIVIDE([Measure1],[Measure2])
Datediff = 
Var _date1=CALCULATE(MIN('Table'[operational_date]),ALLEXCEPT('Table','Table'[internal_id]))
Var _date2=CALCULATE(MAX('Table'[operational_date]),ALLEXCEPT('Table','Table'[internal_id]))
RETURN
DATEDIFF(_date1,_date2+1,HOUR)
Result = DIVIDE([Measure3],[Datediff])

vzhangtinmsft_0-1725257093285.png

Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.