cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## creating a percentage for time

Hey everyone, I am needing to find the amount of time a network is online per month. I have the total minutes each network is online per month.

how can I go about doing this?

1 ACCEPTED SOLUTION
Impactful Individual

You can use the DATEDIFF function with MINUTE as the interval to calculate the total minutes between two dates.

If you have a date dimension I would use that as the basis, and try a measure such as this:

``````% Time Online =
VAR __TimeOnline = [TimeOnlineMeasure]
VAR __MinDate = MIN( Dates[Date] )
VAR __MaxDate = MAX( Dates[Date] )
VAR __TotalMinutes =
DATEDIFF( __MinDate, __MaxDate, MINUTE )
RETURN
DIVIDE( __TimeOnline ,  __TotalMinutes )``````

TimeOnlineMeasure is the placeholder for the calculation that gives you the total minutes the network was online.

Impactful Individual

You can use the DATEDIFF function with MINUTE as the interval to calculate the total minutes between two dates.

If you have a date dimension I would use that as the basis, and try a measure such as this:

``````% Time Online =
VAR __TimeOnline = [TimeOnlineMeasure]
VAR __MinDate = MIN( Dates[Date] )
VAR __MaxDate = MAX( Dates[Date] )
VAR __TotalMinutes =
DATEDIFF( __MinDate, __MaxDate, MINUTE )
RETURN
DIVIDE( __TimeOnline ,  __TotalMinutes )``````

TimeOnlineMeasure is the placeholder for the calculation that gives you the total minutes the network was online.