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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tejasp
Frequent Visitor

Change Format for Measure

Hi Team,

 

I have a table that contains data for logging hours on various statuses.

 

tejasp_3-1617890844680.png

 

I have created a measure that sums a few of the statuses

(Scheduled_Hours = SUM(Schedules[Working Hours for Activities])+SUM(Schedules[ADMIN]).

 
The result which I am expecting is in the "[HH]:MM" formate but the output looks like below:

tejasp_2-1617890727938.png

 

Can anyone please advise what might be wrong here?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tejasp ,

 

Thanks for your reply. The default time format in Power BI is 24 hour system. The format you requested is only text format in Power BI, so it cannot be used for calculations. I suggest that you could convert the time format into a decimal format to facilitate calculations. Just like this as follows.

Scheduled hours_new = 

SUMX (

FILTER ( ALL ( 'test_hhnn' ), [Date] = SELECTEDVALUE ( test_hhnn[Date] ) ),

HOUR ( [D1] ) + HOUR ( [D2] )+(MINUTE ( [D1] ) + MINUTE ( [D2] ))/60

)
v-yuaj-msft_0-1618363171660.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @tejasp ,

 

Based on your description, I think you may be want a time format that does not actually have to conform to the 24-hour clock.

I did a test. Here is my test table. you can create a measure as follows.

v-yuaj-msft_0-1618207241082.png

Scheduled hours = 

SUMX (

FILTER ( ALL ( 'test_hhnn' ), [Date] = SELECTEDVALUE ( test_hhnn[Date] ) ),

HOUR ( [D1] ) + HOUR ( [D2] )

)

+ INT (

SUMX (

FILTER ( ALL ( 'test_hhnn' ), [Date] = SELECTEDVALUE ( test_hhnn[Date] ) ),

MINUTE ( [D1] ) + MINUTE ( [D2] )

) / 60

) & ":"

& FORMAT (

MOD (

SUMX (

FILTER ( ALL ( 'test_hhnn' ), [Date] = SELECTEDVALUE ( test_hhnn[Date] ) ),

MINUTE ( [D1] ) + MINUTE ( [D2] )

),

60

),

"#00"

)
Result:
(Result in Excel)
v-yuaj-msft_1-1618207286357.png

(Result in Power BI Desktop)

v-yuaj-msft_2-1618207311141.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymousthank you for your inputs, the dax helped me to achive the number but its not useful if I am trying to do any other mathematical operation, ( Late hours/ Scheduled hours) etc.

Anonymous
Not applicable

Hi @tejasp ,

 

Thanks for your reply. The default time format in Power BI is 24 hour system. The format you requested is only text format in Power BI, so it cannot be used for calculations. I suggest that you could convert the time format into a decimal format to facilitate calculations. Just like this as follows.

Scheduled hours_new = 

SUMX (

FILTER ( ALL ( 'test_hhnn' ), [Date] = SELECTEDVALUE ( test_hhnn[Date] ) ),

HOUR ( [D1] ) + HOUR ( [D2] )+(MINUTE ( [D1] ) + MINUTE ( [D2] ))/60

)
v-yuaj-msft_0-1618363171660.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HarishKM
Memorable Member
Memorable Member

@tejasp  Hey mate ,
Kindly refer below image and use that dax formula to fulfill your requirement .

total min =
SUMX ( 'Sheet1', HOUR ( Sheet1[Shift 1 ] ) )
+ TRUNC ( SUMX ( 'Sheet1', MINUTE ( Sheet1[Shift 1 ] ) ) / 60 ) & ":"
& MOD ( SUMX ( Sheet1, MINUTE ( Sheet1[Shift 1 ] ) ), 60 ) & ":00"

 

HarishKM_0-1617942743207.png

 

Kudos will be appriciated .

 

 

 

@HarishKMThank you for your response. By using this dax it tend to show higher number than actual. I think the mod function is causing a trouble, when agent is scheuled HH:30 hours.

edhans
Super User
Super User

Click on the measure and the Measures Tools tab should become active. Pick the time format. this one is all the way at the bottom.

edhans_0-1617897180944.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
tejasp
Frequent Visitor

Hi @edhans thanks for the response, I had already tried that but its not helping. Along with it I also tried to use Formate{SUM(Schedules[Working Hours for Activities])+SUM(Schedules[ADMIN]),"hh:nn") but its not helpful either.

below is the output in PowerBI:

tejasp_0-1617940533863.png

 

using same filter output in Excel:

tejasp_1-1617940584808.png

 

You are going to have to provide some data @tejasp - You wanted HH:MM, and that is what I gave you, and now you are actually showing HH:MM and saying it isn't right, then you show 08:00 for the first record, but Excel shows 504:00.

I have no idea what your data is and what is expected based on that.

 

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
tejasp
Frequent Visitor

Hi @edhans apologies if the request was not clear.

 

Below is how my data looks like:

tejasp_0-1618308782793.png

 

From This data I would like to get achieve things like shrinkage %, total working hours, Scheduled hours etc.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.