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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rachelbi
Helper I
Helper I

Create new measure instead of new column

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 .. 

 

1.PNG

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@manvishah17 

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" )
    )

jdbuchanan71_0-1715605440561.png

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@manvishah17 

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" )
    )

jdbuchanan71_0-1715605440561.png

 

 

manvishah17
Solution Supplier
Solution Supplier

Hi @rachelbi , can you ellaborate more about from what you want to calculate hours and  completion %  or can you share sample dataset?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors