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
derekma19
Frequent Visitor

Line Chart with two lines with different values and dates using a unique X axis

Hi, I'm trying to display 2 lines of values based on different dates. The data is as shown as below.

 

StartDateEndDateStartValueEndValue
01 Jan 202115 Jan 202156
01 May 202125 Jun 20211521
01 Aug 202101 Sep20212426

 

now I want to put in the same line chart both lines. However, if I use StartDate in the X Axis, the EndValue won't be correctly displayed and the same will happend with the Start Value.  For example, in the image below the 01/Sep/2021 it is displaying 24 and 26 when it should be only 26. Image below for reference.

 

I'm getting this

derekma19_0-1669371199641.png

 

and I want to get something like this 

 

derekma19_3-1669371562756.png

 

I believe I need a DateTable from the dates I am interested in and make a relationship with my dates table but I've tried relationship with Start and End Date and It doesn't work.

 

Any idea is more than welcome

 

Thanks!

 

 

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @derekma19 

If you have a calendar table, you can try add another inactive relationship between ‘Table’[EndDate] and 'Calendar'[Date].

veasonfmsft_0-1669706668041.png

 

Then put 'Calendar'[Date]  to the x-axis of line chart , and put the following two measure to the y-axis of line chart.

M_startvalue = SUM('Table'[StartValue])
M_EndValue = CALCULATE(SUM('Table'[EndValue]),USERELATIONSHIP('Table'[EndDate],'Calendar'[Date]))

veasonfmsft_1-1669706815993.png

 

USERELATIONSHIP 

Please check attached pbix for more details.

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @derekma19 

If you have a calendar table, you can try add another inactive relationship between ‘Table’[EndDate] and 'Calendar'[Date].

veasonfmsft_0-1669706668041.png

 

Then put 'Calendar'[Date]  to the x-axis of line chart , and put the following two measure to the y-axis of line chart.

M_startvalue = SUM('Table'[StartValue])
M_EndValue = CALCULATE(SUM('Table'[EndValue]),USERELATIONSHIP('Table'[EndDate],'Calendar'[Date]))

veasonfmsft_1-1669706815993.png

 

USERELATIONSHIP 

Please check attached pbix for more details.

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@derekma19 , refer if these approaches can help

Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Tables way
https://amitchandak.medium.com/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.