Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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.
Solved! Go to Solution.
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)))
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 .
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
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)))
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 .
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |