The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I'm working on taking a count of minutes, and breaking it into days, hours and minutes. I got the majority of the DAX coding working, but if the minutes is exactly an hour (60 minutes, 120 minutes, etc), the 'Total Minutes' VAR is blank, so the result is "1 Hour, Minutes." How can I default VAR Total Minutes to "0" if it is exactly an hour.
Solved! Go to Solution.
Course Time =
VAR TotalMinutes = SUM( 'Course Information'[MIN] )
VAR TotalDays = DIVIDE( TotalMinutes, 1440, 0)
var days = INT( TotalDays )
Var remainingHours = MOD( COALESCE( TotalDays,0 ), 1 ) * 24
Var hours = INT( remainingHours )
Var remainingMins = MOD( COALESCE( remaingHours, 0 ), 1 ) * 60
Var mins = INT( min )
Return
If( days > 0, days & " days " ) &
If( hours > 0, hours & " hours ") &
If( mins > 0, mins & " minutes")
Hi,
While the if logic will also work you can easily do something like this:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi,
While the if logic will also work you can easily do something like this:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Course Time =
VAR TotalMinutes = SUM( 'Course Information'[MIN] )
VAR TotalDays = DIVIDE( TotalMinutes, 1440, 0)
var days = INT( TotalDays )
Var remainingHours = MOD( COALESCE( TotalDays,0 ), 1 ) * 24
Var hours = INT( remainingHours )
Var remainingMins = MOD( COALESCE( remaingHours, 0 ), 1 ) * 60
Var mins = INT( min )
Return
If( days > 0, days & " days " ) &
If( hours > 0, hours & " hours ") &
If( mins > 0, mins & " minutes")
Misread the request just use
COALESCE( minutes, 0)
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
8 | |
8 |