Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
i have this data in source (Odpoledne = Afternoon, Dopoledne=morning,Konec=end)
and i need calculate total run time per day (based RecordDate)
Something like this (Morning/End-Morning/Start) + (Afternoon/End - Afternoon/Start)
Is it possible?
Thanks a lot
Jakub
Solved! Go to Solution.
Hi @Flashback87
Change the data type of 'StatisticValueText'column to time, then create a calculated column.
TotalMintes =
VAR _filter =
FILTER (
'Table',
[IDOfRecord] = EARLIER ( 'Table'[IDOfRecord] )
&& [InstrumentCode] = EARLIER ( 'Table'[InstrumentCode] )
&& [RecordDate] = EARLIER ( 'Table'[RecordDate] )
)
VAR _morning =
FILTER ( _filter, [StatisticGroupName] = "Dopoledne" )
VAR _after =
FILTER ( _filter, [StatisticGroupName] = "Odpoledne" )
RETURN
DATEDIFF (
CONVERT (
[RecordDate] & " "
& MINX ( _morning, [StatisticValueText] ),
DATETIME
),
CONVERT (
[RecordDate] & " "
& MAXX ( _morning, [StatisticValueText] ),
DATETIME
),
MINUTE
)
+ DATEDIFF (
CONVERT ( [RecordDate] & " " & MINX ( _after, [StatisticValueText] ), DATETIME ),
CONVERT ( [RecordDate] & " " & MAXX ( _after, [StatisticValueText] ), DATETIME ),
MINUTE
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Flashback87
Change the data type of 'StatisticValueText'column to time, then create a calculated column.
TotalMintes =
VAR _filter =
FILTER (
'Table',
[IDOfRecord] = EARLIER ( 'Table'[IDOfRecord] )
&& [InstrumentCode] = EARLIER ( 'Table'[InstrumentCode] )
&& [RecordDate] = EARLIER ( 'Table'[RecordDate] )
)
VAR _morning =
FILTER ( _filter, [StatisticGroupName] = "Dopoledne" )
VAR _after =
FILTER ( _filter, [StatisticGroupName] = "Odpoledne" )
RETURN
DATEDIFF (
CONVERT (
[RecordDate] & " "
& MINX ( _morning, [StatisticValueText] ),
DATETIME
),
CONVERT (
[RecordDate] & " "
& MAXX ( _morning, [StatisticValueText] ),
DATETIME
),
MINUTE
)
+ DATEDIFF (
CONVERT ( [RecordDate] & " " & MINX ( _after, [StatisticValueText] ), DATETIME ),
CONVERT ( [RecordDate] & " " & MAXX ( _after, [StatisticValueText] ), DATETIME ),
MINUTE
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 59 | |
| 31 | |
| 25 | |
| 25 |