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
Anonymous
Not applicable

Trouble Displaying Two Overlapping Line Graphs in Power BI using Dax functions

Hello Power BI community,

 

I recently ran into an issue where I was trying to display two line graphs on top of one another in Power BI, but instead, they were being displayed as a single continuous graph line. The two functions that I was using were:

 

Jack_Reacher_0-1683027139396.png

 

 

AAAM_Prior_R12M = CALCULATE([Sum_Two_Rows], DATESINPERIOD('Calendrier'[Date],ENDOFMONTH(dateadd('Appointments Manager'[Period date],-12,month)),-12,MONTH))

 

AAAM_Current_R12M = CALCULATE(([Sum_Two_Rows]), DATESINPERIOD('Calendrier'[Date], ENDOFMONTH('Appointments Manager'[Period date]), -12, MONTH))

 

The Period date is a date column of the table Appointments manager.

I appreciate your assistance. 

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

Hi , @Anonymous 

Accoridng to your description, you put two measures on the viusal and it only show one measure.

And for the [AAAM_Prior_R12M] measure , it seems to get the the sum of the first 24 months of the current year to the previous 12 months.

I test it in my side , it seems work good for this dax .

AAAM_Current_R12M = IF(ENDOFMONTH('Appointments Manager'[Period date])<>BLANK(), CALCULATE(([Sum_Two_Rows]), DATESINPERIOD('Calendrier'[Date], ENDOFMONTH('Appointments Manager'[Period date]), -12, MONTH)))
AAAM_Prior_R12M = 
 var _cur= MAX('Calendrier'[Date])
 var _pre12 =YEAR( EOMONTH(_cur,-12))*100+MONTH( EOMONTH(_cur,-12))
 var min_date =YEAR( MINX( ALLSELECTED('Appointments Manager') , [Period date])) *100  +MONTH( MINX( ALLSELECTED('Appointments Manager') , [Period date]))
 return
IF(_pre12<min_date,BLANK(), CALCULATE([Sum_Two_Rows], DATESINPERIOD('Calendrier'[Date],ENDOFMONTH(dateadd('Appointments Manager'[Period date],-12,month)),-12,MONTH)))

vyueyunzhmsft_0-1683173177150.png

vyueyunzhmsft_1-1683173208380.png

 

And for your need , you can just convert the bar chart to the Table visual so that we can see the measure reutrns that may return blank in your side .

vyueyunzhmsft_2-1683173262843.png

 

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

Accoridng to your description, you put two measures on the viusal and it only show one measure.

And for the [AAAM_Prior_R12M] measure , it seems to get the the sum of the first 24 months of the current year to the previous 12 months.

I test it in my side , it seems work good for this dax .

AAAM_Current_R12M = IF(ENDOFMONTH('Appointments Manager'[Period date])<>BLANK(), CALCULATE(([Sum_Two_Rows]), DATESINPERIOD('Calendrier'[Date], ENDOFMONTH('Appointments Manager'[Period date]), -12, MONTH)))
AAAM_Prior_R12M = 
 var _cur= MAX('Calendrier'[Date])
 var _pre12 =YEAR( EOMONTH(_cur,-12))*100+MONTH( EOMONTH(_cur,-12))
 var min_date =YEAR( MINX( ALLSELECTED('Appointments Manager') , [Period date])) *100  +MONTH( MINX( ALLSELECTED('Appointments Manager') , [Period date]))
 return
IF(_pre12<min_date,BLANK(), CALCULATE([Sum_Two_Rows], DATESINPERIOD('Calendrier'[Date],ENDOFMONTH(dateadd('Appointments Manager'[Period date],-12,month)),-12,MONTH)))

vyueyunzhmsft_0-1683173177150.png

vyueyunzhmsft_1-1683173208380.png

 

And for your need , you can just convert the bar chart to the Table visual so that we can see the measure reutrns that may return blank in your side .

vyueyunzhmsft_2-1683173262843.png

 

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.