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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Will_Smothers
New Member

Help With a Stacked Line Chart

We are a manufacturing company and we are working on ingesting data in PowerBI to help us drive efficiencies. Currently we are collecting the following data into an Excel spreadsheet:

  • Date of production (not time just date)
  • Machine the part was run on
  • Customer the part was for
  • The Work Order Number
  • The Part Number
  • The schedule time it should take to make the part
  • The actual time it took to make the part
  • Number of pieces completed
  • Notes about the run

The issue is that all of the columns are going to have the same numbers multiple times and when I import the data into PowerBI, it wants to sum them and not show the actual times. My goal with the Stacked Line Chart is to have the Part number on the X-axis, the Y-axis be time and the two stacked lines be Scheduled time vs Actual time. A filter could be applied to the chart to help narrow down the scope based on the date. Here is some sample data:

 

DATEMACHINECUSTOMERW/O#PART#SCHED: RATE/PCACT: RATE/PC:
Monday, September 30, 2024LT7Customer1W08056510942700:18.000:19.0
Monday, September 30, 2024LT7Customer1W07910311898900:30.000:21.3
Monday, September 30, 2024LT7Customer1W07910712937300:30.000:21.0
Tuesday, October 8, 2024LT7Customer2W028546828546800:24.000:00.0
Tuesday, October 8, 2024LT7Customer1W080848428596800:24.000:27.0
Wednesday, October 9, 2024LT7Customer1W08060328864700:30.000:16.0
Wednesday, October 9, 2024LT7Customer1W08060228869800:30.000:16.0
Tuesday, October 8, 2024LT7Customer3W08056441413400:15.000:00.0
Monday, October 7, 2024LT7Customer3W08055141420100:18.000:25.0
Monday, October 7, 2024LT7Customer3W08055141420200:15.000:21.0
Tuesday, October 8, 2024LT7Customer3W08056441420600:36.000:57.0
Tuesday, October 8, 2024LT7Customer3W08056441420700:36.001:00.0
Tuesday, October 8, 2024LT7Customer3W08056441420800:12.000:25.0
Monday, September 30, 2024LT7Customer3W08035641438001:00.0

00:15.0

 

Any help anyone can provide me on this would be GREATLY appreciated. I have been struggling with how to make this work for two weeks. Once I have it in PowerBI, I want to publish it in Teams (which is where the Excel file lives) so that we have graphical representation of the our efficiency.

 

Thanks in advance for this communities help with this.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Will_Smothers ,

 

Create the following two measures:

Schedulle = HOUR(MAX('Table'[SCHED: RATE/PC]))+MINUTE(MAX('Table'[SCHED: RATE/PC]))/100

Actual = HOUR(MAX('Table'[ACT: RATE/PC:]))+MINUTE(MAX('Table'[ACT: RATE/PC:]))/100

Add the dynamic format in the following way:

 

"""" & FORMAT(MAX('Table'[ACT: RATE/PC:]), "hh:mm") & """"

"""" & FORMAT(MAX('Table'[SCHED: RATE/PC]), "hh:mm:ss") & """"

 

Now add it to the visual:

MFelix_0-1732104559889.png

Check PBIX file attach.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
Will_Smothers
New Member

THANK YOU!!! That is exactly what I needed!

 

What this post has shown me is that I need to really dig into writing DAX and start understanding it better! I struggled with this for two solid weeks and you fixed it with four lines of DAX!!

 

Thank you very Much Miguel!!!

Hi @Will_Smothers ,

 

The main question over here is the fact that visualizations don't play nice with time or date formats, so you need to transform them into numbers, in this case decimals, and them make a formatting of that result.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @Will_Smothers ,

 

Create the following two measures:

Schedulle = HOUR(MAX('Table'[SCHED: RATE/PC]))+MINUTE(MAX('Table'[SCHED: RATE/PC]))/100

Actual = HOUR(MAX('Table'[ACT: RATE/PC:]))+MINUTE(MAX('Table'[ACT: RATE/PC:]))/100

Add the dynamic format in the following way:

 

"""" & FORMAT(MAX('Table'[ACT: RATE/PC:]), "hh:mm") & """"

"""" & FORMAT(MAX('Table'[SCHED: RATE/PC]), "hh:mm:ss") & """"

 

Now add it to the visual:

MFelix_0-1732104559889.png

Check PBIX file attach.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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