Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi there, I have encountered a silly question which drag me for long time ... How to create a DAX measure instead of new column fron the table, as I want to know in each project , how much time have been spend in HOURS. I want the DAX measure for following calculation such as % completion. Thanks.
Note that in the table, each project id might have duplicate task id ..
Solved! Go to Solution.
You can do this with 2 measures.
The first one to add up the minutes.
Task Minutes = SUM ( 'YourTable'[Task Actual Time Minutes] )
The second one to format that duration into hh:mm format at whatever level it is viewed.
Task Duration (hh:mm) =
VAR _Minutes = [Task Minutes]
VAR _Hours = INT ( DIVIDE ( _Minutes, 60 ) )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )
RETURN
IF (
NOT ISBLANK ( _Minutes ),
FORMAT ( _Hours, "00" ) & ":" &
FORMAT ( _RemainingMinutes, "00" )
)
You can do this with 2 measures.
The first one to add up the minutes.
Task Minutes = SUM ( 'YourTable'[Task Actual Time Minutes] )
The second one to format that duration into hh:mm format at whatever level it is viewed.
Task Duration (hh:mm) =
VAR _Minutes = [Task Minutes]
VAR _Hours = INT ( DIVIDE ( _Minutes, 60 ) )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )
RETURN
IF (
NOT ISBLANK ( _Minutes ),
FORMAT ( _Hours, "00" ) & ":" &
FORMAT ( _RemainingMinutes, "00" )
)
Hi @rachelbi , can you ellaborate more about from what you want to calculate hours and completion % or can you share sample dataset?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.