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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JohnJoe123
Helper II
Helper II

Line & Clustered Column Chart - Issue obtaining a Continous Line if X-Axis is Date

Hi Everyone,

Apologies if my Question Title was not clear enough.

Or if my Description is too Long.

 

So, I'm basically trying to fix a line & clustered column chart that I've made in Power BI Desktop.

I'm pulling all my data from a Database where I work.

 

I work in a Factory that makes Sensors.

And I'm making Power BI Visuals to see how many Alarms occur on a Machine when it is processing Sensors.

 

So for Right now, I've picked just one machine and I am currently looking at its data for September 2023.

And I'm looking at everything on a day-by-day basis. (Everything on 1st September, then 2nd September etc.)

 

The main metrics that I am looking at for each day are:

1. How Many Alarms Occur in a Day (These are the Columns in the Chart)

 

2. The Running Time of the Machine (in Total Minutes) that Day

- I Don't actually need to Show this on the Chart but it is important for Metric 3.

- Note also - that the Machine does not Run every Day - so this will sometimes be 0 Minutes

 

3. The Mean Time Between Failures (MTBF) (This is the Line on the Chart)

- My Boss said that the MTBF for each day is calculated from this Formula:

(Minutes the Machine Running that Day) Divided by (No. of Alarms that Day)

 

> So if the Machine is not Running that Date - it's Duration will be 0.

> And so obviously, no Alarms can occur if the Machine is not running - so it's Alarm Count for that Date will also be 0.

> So the MTBF will be 0 Divided by 0 - which by default displays 'null ' but I've changed it to '0' to make sense of it.

 

Here is a table of the Data that I currently have:

DATERUN TIME (Mins.)     ALARM COUNT  MTBF
01-Sep-23         13411389.72
02-Sep-23          380537.17
03-Sep-23           000.00
04-Sep-23           000.00
05-Sep-23           000.00
06-Sep-23           000.00
07-Sep-23           000.00
08-Sep-23           000.00
09-Sep-23         4301343.21
10-Sep-23           000.00
11-Sep-23           000.00
12-Sep-23           000.00
13-Sep-23        388576.81
14-Sep-23           000.00
15-Sep-23           000.00
16-Sep-23           000.00
17-Sep-23           000.00
18-Sep-23           000.00
19-Sep-23           000.00
20-Sep-23          57105.70
21-Sep-23        13151747.56
22-Sep-23        12481329.45
23-Sep-23         8431605.27
24-Sep-23          000.00
25-Sep-23          000.00
26-Sep-23          000.00
27-Sep-23          000.00
28-Sep-23          000.00
29-Sep-23          000.00
30-Sep-23          000.00

 

My Desired Graph would be this:

JohnJoe123_0-1701172404520.png

Notice how in this desired graph, if the Machine does not run that day (and hence the MTBF is null and void for that date), the MTBF Line sumply continues to the next available figure. (In the first instance in the desired image; it jumps straight from 02SEP23 to 09SEP23 since the machine was not running between these 2 Dates).

 

 

However, I cannot seem to obtain this desired result.

 

The Default Graph I get from the Data my table is this: (MTBF is 0 for Days Machine is not Running)

JohnJoe123_2-1701172736077.png

 

If I replace the MTBF '0' values with 'null'; I get this:

JohnJoe123_3-1701172777586.png

 

And if I replace the Dates where the Machine is not running with 'null', I get this:

JohnJoe123_4-1701172825700.png

 

1 REPLY 1
HotChilli
Super User
Super User

You will have to remove those 0 values (either from the data or from the visual) to get the chart you want.

You can experiment with a slicer that holds all the MTBF values.  Select everything that is not zero and I reckon you will get the right chart.

So, if you prove that, you can either remove all the zero rows in power query or use a slicer, somethinglike that.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.