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 September 15. Request your voucher.

Reply
Ortignano
Helper II
Helper II

How plot sames series in 2 line chart

Hello,

I have a measure calculated each month from 2018 up today. I would plot a series for 2022 and one series for 2023 to compare them (in simila rway to the chart below). Do you have any suggestion? (create 2 sereies, 1 filter for 2022 and 1 filtered for 2023 it seems doesn't work as my measure take in count the latest 12 months).

Thnak you

Ortignano_0-1697470631301.png

 

onth but I would compare last 2 years creating a chart as attached

Ortignano_0-1697470631301.png

 

onth but I would compare last 2 years creating a chart as attached

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Ortignano 

 

You can try the following methods.

Sample data:

vzhangti_0-1697611089944.png

Need to create a new date table.

Date = CALENDAR(DATE(2022,1,1),DATE(2023,12,31))

vzhangti_1-1697611141692.png

Measure 2022 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2022&&[Month]=SELECTEDVALUE('Date'[Month])))
Measure 2023 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2023&&[Month]=SELECTEDVALUE('Date'[Month])))

vzhangti_2-1697611188755.png

Is this the result you expect? If not, please provide more details.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
Ortignano
Helper II
Helper II

hank you it can work, bt thge way I solved creating a measure using 

Measure Prior Year = CALCULATE([Measure],SAMEPERIODLASTYEAR('Calendar Lookup'[Date]))
It dosn't give me the initial day but it can be sufficient for now
v-zhangti
Community Support
Community Support

Hi, @Ortignano 

 

You can try the following methods.

Sample data:

vzhangti_0-1697611089944.png

Need to create a new date table.

Date = CALENDAR(DATE(2022,1,1),DATE(2023,12,31))

vzhangti_1-1697611141692.png

Measure 2022 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2022&&[Month]=SELECTEDVALUE('Date'[Month])))
Measure 2023 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2023&&[Month]=SELECTEDVALUE('Date'[Month])))

vzhangti_2-1697611188755.png

Is this the result you expect? If not, please provide more details.

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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