This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 23 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 61 | |
| 36 | |
| 29 | |
| 22 | |
| 21 |