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
Anonymous
Not applicable

What the heck is the problem?

Hello,

I have a measure to sum the duration of minutes to hours. The problem is, its working perfect but only as a table or matrix?! I can not put the measure to the fiel values to make eg. a bar chart. How can I fix this? And I also cant change the data type of the measure. (It is text)

Zeitaufwand Delegation/Gruppen =

VAR TotalSeconds=SUMX('Zeitaufwand Bewirtungen',HOUR('Zeitaufwand Bewirtungen'[Zeitaufwand Delegation/Gruppen])*3600+MINUTE('Zeitaufwand Bewirtungen'[Zeitaufwand Delegation/Gruppen])*60+SECOND('Zeitaufwand Bewirtungen'[Zeitaufwand Delegation/Gruppen]))
VAR Days =TRUNC(TotalSeconds/3600/24)
VAR Hors = TRUNC((TotalSeconds-Days*3600*24)/3600)
VAR Mins =TRUNC(MOD(TotalSeconds,3600)/60)
VAR Secs = MOD(TotalSeconds,60)
return IF(DAYS=0,"",IF(DAYS>1,DAYS&"days ",Days&"day"))&IF(Hors<10,"0"&Hors,Hors)&":"&IF(Mins<10,"0"&Mins,Mins)&":"&IF(Secs<10,"0"&Secs,Secs)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

As @HotChilli said, your measure returns a text which could not be plotted on a chart(Y-axis) .

So you could only apply TotalSeconds to Y-axis instead because it is a number value . And then drag your measure to Tooltips.

 

Or you could change TotalSeconds to Duration in Power Query as shown below:

Eyelyn9_0-1636424030426.png

Eyelyn9_2-1636424078829.png

Output:

Eyelyn9_3-1636424774331.png

 

Or refer to this blog:https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/td-p/793639

Eyelyn9_4-1636424857476.png

 

Best Regards,
Eyelyn Qin
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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

As @HotChilli said, your measure returns a text which could not be plotted on a chart(Y-axis) .

So you could only apply TotalSeconds to Y-axis instead because it is a number value . And then drag your measure to Tooltips.

 

Or you could change TotalSeconds to Duration in Power Query as shown below:

Eyelyn9_0-1636424030426.png

Eyelyn9_2-1636424078829.png

Output:

Eyelyn9_3-1636424774331.png

 

Or refer to this blog:https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/td-p/793639

Eyelyn9_4-1636424857476.png

 

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

HotChilli
Super User
Super User

 TotalSeconds is the only one that is correct for the whole total

The other variables all work from TotalSeconds -> the final result is a text representation of TotalSeconds split into Days,Hours,Minutes,Seconds.

I haven't looked at in detail but it seems right.  You have to decide what you want to return.

HotChilli
Super User
Super User

Presumably this is because the measure returns a text representation D:H:M:S .  You can't add this with another value - it doesn't make sense.

You might have a chance if you return a number (seconds, minutes or whatever)

Anonymous
Not applicable

How can I return a number? I found the Measure on the internet, I'm not a DAX Expert 😄

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.