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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Zneta
Frequent Visitor

N/A

N/A

3 REPLIES 3
Zneta
Frequent Visitor

Can anyone help me out with this problem? Like i said. The first idea is not bad but it doesnt quite work or I made a mistake

Zneta
Frequent Visitor

Thank you, this is a great starting point. I followed your steps but for some reason the Fault Durations are not being added up. For example the first two Faults are within the same time frame. So the first faultduration should read 1696 as it is 1696 seconds long. The second FaultDuration should also read 1696 since that fault is in the time frame of the first and wont add to the total. why does it only show 5? unlike in your example.

 

Capture12.JPG

v-yangliu-msft
Community Support
Community Support

Hi  @Zneta ,

 

Here are the steps you can follow:

1. Create calculated column.

Date =
DATE(YEAR('Table'[Fault start]),MONTH('Table'[Fault start]),DAY('Table'[Fault start]))
Minute =
var _mindate=
MINX(FILTER(ALL('Table'),'Table'[Date]=EARLIER('Table'[Date])),[Fault start])
var _maxdate=
MAXX(FILTER(ALL('Table'),'Table'[Date]=EARLIER('Table'[Date])),[Fault end])
return
DATEDIFF(
    _mindate,_maxdate,MINUTE)

vyangliumsft_0-1716169955067.png

2. Create measure.

Measure =
var _mindate=MAX('Table'[Date]) + TIME(0,0,0)
var _maxdate=_mindate +1
var _oneday=
DATEDIFF(
    _mindate,_maxdate,MINUTE)
return
_oneday - MAX('Table'[Minute])

3. Result:

vyangliumsft_1-1716169955069.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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