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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
morther
Helper I
Helper I

Calculation function only returning minutes

I have created a New Column called Downtime.  It is supposed to take the total Downtime Minutes and break it into Days, Hours, and Minutes.  It is pulling the remainder minutes properly but is not adding the hours beforehand.

 

(Source Column)
Downtime Minutes                                         Downtime
99.00                                                                     0 day  00 hours  33 Min

 

This should read 0 day  01 hours  33 Min, but is missing the hour.

Below is the DAX code:

Downtime =
VAR dayNo =
    INT ( EventLogDetail[DowntimeMinutes] / 1440 )
VAR hourNo =
    INT ( MOD ( EventLogDetail[DowntimeMinutes], 1440 ) / 60 )
VAR minuteNo =
    MOD ( MOD ( EventLogDetail[DowntimeMinutes], 1440 )60 )
RETURN
    dayNo & " day  "
        & FORMAT ( hourNo, "#00" )
        & "  hours "
        & FORMAT ( minuteNo, "#00" )
        & " Min"

Any help would be greatly appreciated.

Thanks,

Mike

1 ACCEPTED SOLUTION

Can you post some sample data of your downtime table?  The issue might be that you need to specify some type of aggregation for your downtime minutes column, rather than the raw column reference you are providing.  In my example, I just hard coded in the number 99, but if you have multiple values in your downtime minutes column, it wont work by just giving the column name.

View solution in original post

13 REPLIES 13

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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