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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
whitej
Frequent Visitor

Using time data type as a value in bar chart

I have a column showing seconds (whole numbers) and would like to convert it to hh:mm and use it in a bar chart with date on the Y axis. Is it possible in Power BI? I have managed to create a column with hh:mm but when pulled into the value field it only displays the count.

 

Thank you

 

James

9 REPLIES 9
amitchandak
Super User
Super User

@whitej , New time column

time = time(time(Quotient([Col],3600) ,Quotient(Mod([Col],3600),60) ,mod(mod([Col],3600),60)) )

 

Add with date if needed

 

Date time = [Date] +[Time]

 

Use on axis

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Also I need to be able to use the new column as a value and not on an axis

I am getting this error when creating the new column

 

whitej_1-1631795824915.png

 

@whitej See Chelsie Eiden's Duration, I created it for this exact scenario: Chelsie Eiden's Duration - Microsoft Power BI Community



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Do I need to create a new column or measure for this to work?

 

Thank you

Hi, @whitej 

 

What's your original column and what do you want to change to? Can you share some sample data? So we can help you soon.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.


Best Regards,

Community Support Team _ Janey

So I have created a new measure called Duration Engineering Done to convert seconds to hh:mm:ss and it looks fine.

 

whitej_0-1632394332276.png

 

But I only want to see hh:mm. So if I change the Format at the top to 00:00 and remove the "seconds" in the dax then I am getting the following. 

 

What I want to see is:

 

01-Jul-21 01:26

02-Jul-21 00:10

 

 

whitej_1-1632394662400.png

 

 

Great, thank you. Moving in the correct direction. I just had to remove the SUM from VAR Duration = SUM[Duration[

 

Also do not need the seconds so this is what I have done but having a slight problem when changing the fromat from 00:00:00 to 00:00. Looking at my DurationTime Column there is no : between my hour and my minute. Anything I can do to fix this?

 

 

 

whitej_2-1631798725127.png

 

 

 

whitej_1-1631798668101.png

 

 

 

Another way to do what you want is to keep your duration column as a decimal, create two measures (one for your total decimal, and one with that formatted as "hh:mm"), and use the Charticulator visual to make your chart.  You would use the text measure in a text box label at the top of the bars.

(15) Austin Power BI User Group - Charticulator 101 - YouTube

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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