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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vgangabharani
Frequent Visitor

grant total of time in matrix

I have a table like below:

DatenameHours spent
1/1/2010a8:00
2/3/2010a1:00
3/8/2010b10:00
4/10/2010c19:00
1/1/2010a1:00
6/15/2010d20:00

 

When I load and use a table with name and hours spent I get the below with a having cumulative value of 10:00

nameHours spent
a10:00
b10:00
c19:00
d20:00

 

When I use matrix the sum is wrong. I am using a measure= sum(hours spent) in the matrix. 

nameDateHours spent
a 8:00
a1/1/20108:00
a2/3/20101:00
a1/1/20101:00

 

the grand total is just the first row value. Can someone help me understand this?

2 ACCEPTED SOLUTIONS
v-frfei-msft
Community Support
Community Support

Hi @vgangabharani ,

 

To create a measure as below.

hour = SUMX('Table',HOUR('Table'[Hours spent]))

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Thanks for this. I aggregated time like this: 

Measuredummy = If(SUMX(timelog,Minute(timelog[Hours]))>=60,
concatenate(
concatenate(
//hour
SUMX(timelog,HOUR(timelog[Hours]))+quotient(SUMX(timelog,Minute(timelog[Hours])),60), ":"),
//minute
format(mod(SUMX(timelog,Minute(timelog[Hours])),60),"00")),
//else
concatenate(
concatenate(
SUMX(timelog,HOUR(timelog[Hours])),":"),format(SUMX(timelog,Minute(timelog[Hours])),"00")))

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @vgangabharani ,

 

To create a measure as below.

hour = SUMX('Table',HOUR('Table'[Hours spent]))

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thanks for this. I aggregated time like this: 

Measuredummy = If(SUMX(timelog,Minute(timelog[Hours]))>=60,
concatenate(
concatenate(
//hour
SUMX(timelog,HOUR(timelog[Hours]))+quotient(SUMX(timelog,Minute(timelog[Hours])),60), ":"),
//minute
format(mod(SUMX(timelog,Minute(timelog[Hours])),60),"00")),
//else
concatenate(
concatenate(
SUMX(timelog,HOUR(timelog[Hours])),":"),format(SUMX(timelog,Minute(timelog[Hours])),"00")))
Greg_Deckler
Super User
Super User

I cannot recreate this. See Page 7, Table10 of attached.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.