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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
JoshS
Frequent Visitor

Comparing line graphs with different x-axes (dates) on the same graph

I am looking to create a single graph that compares 4 different values. The problem I am running into is each value is based off a different date column, which I am looking to combine. Currently, the data exists in 4 seperate graphs as shown below:

 

JoshS_0-1721095506593.png

 

I've created dummy data in excel to demonstrate how the data currently exists in Power BI, and the transformation I am hoping to achieve:

JoshS_1-1721095560414.png

JoshS_2-1721095605760.png

Any help in this would be greatly appreciated.  


1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @JoshS 

 

please check if this accomodate your need.

Irwan_0-1721099991371.png

 

1. create a new date table.

Table 2 = CALENDAR(DATE(2024,6,20),DATE(2024,6,28))
I put minimum date as 20-Jun-2024 and maximum date as 28-Jun-2024.
 
2. create calculated column for average stage 1
Average Work Days in Stage 1 = AVERAGEX(FILTER('Table','Table'[Stage 1 Completion]='Table 2'[Date]),'Table'[Days in Stage 1])
 
3. create calculated column for average stage 2
Average Work Days in Stage 2 = AVERAGEX(FILTER('Table','Table'[Stage 2 Completion]='Table 2'[Date]),'Table'[Days in Stage 2])
 
4. create calculated column for average stage 3
Average Work Days in Stage 3 = AVERAGEX(FILTER('Table','Table'[Stage 3 Completion]='Table 2'[Date]),'Table'[Days in Stage 3])
 
5. create calculated column for average production
Average Work Days in Production = AVERAGEX(FILTER('Table','Table'[Stage 3 Completion]='Table 2'[Date]),'Table'[Work Days in Production])
 
so here are what i found weird in your sample data: 
1. in your desired table at stage 2, the average on 25-Jun-2024 is 2,5. However, if I looked at your power bi data, on 25-Jun-2024, the data are 3 and 1. The average should be 2.
Irwan_1-1721100332000.png

2. From what i see, the Average Work Days in Production is taking same date as Stage 3 Completion.

Irwan_2-1721100471189.png

 

Hope this will help you.

Thank you.

View solution in original post

2 REPLIES 2
JoshS
Frequent Visitor

Thanks Irwan, that was exactly what I needed.

Irwan
Super User
Super User

hello @JoshS 

 

please check if this accomodate your need.

Irwan_0-1721099991371.png

 

1. create a new date table.

Table 2 = CALENDAR(DATE(2024,6,20),DATE(2024,6,28))
I put minimum date as 20-Jun-2024 and maximum date as 28-Jun-2024.
 
2. create calculated column for average stage 1
Average Work Days in Stage 1 = AVERAGEX(FILTER('Table','Table'[Stage 1 Completion]='Table 2'[Date]),'Table'[Days in Stage 1])
 
3. create calculated column for average stage 2
Average Work Days in Stage 2 = AVERAGEX(FILTER('Table','Table'[Stage 2 Completion]='Table 2'[Date]),'Table'[Days in Stage 2])
 
4. create calculated column for average stage 3
Average Work Days in Stage 3 = AVERAGEX(FILTER('Table','Table'[Stage 3 Completion]='Table 2'[Date]),'Table'[Days in Stage 3])
 
5. create calculated column for average production
Average Work Days in Production = AVERAGEX(FILTER('Table','Table'[Stage 3 Completion]='Table 2'[Date]),'Table'[Work Days in Production])
 
so here are what i found weird in your sample data: 
1. in your desired table at stage 2, the average on 25-Jun-2024 is 2,5. However, if I looked at your power bi data, on 25-Jun-2024, the data are 3 and 1. The average should be 2.
Irwan_1-1721100332000.png

2. From what i see, the Average Work Days in Production is taking same date as Stage 3 Completion.

Irwan_2-1721100471189.png

 

Hope this will help you.

Thank you.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.