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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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