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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
BIUser1998
Helper I
Helper I

Line Chart not plotting measure's entire data

Hello,

 

I have two data tables in PowerBI. One of them is called as calendar which has nothing but the names of the 12 months and the second is shown below.

MonthYearValue
Jan2023386
Feb202382391
Mar20233489
Apr2023348
May202323894
Jun202332498
Jul2023389
Aug202323489
Sept20232348
Oct202332498
Nov202338924
Dec20233289
Jan202424390

I have created a relation between the two months columns with the month column from the calendar table on x-axis and in the filter pane. The filter pane has another filter called Year from the second data table

.

I have created two measures as following

Current Year = VAR SelectedYear = SELECTEDVALUE(‘Values’[Year], BLANK())

RETURN

CALCULATE(SUM(‘Values’[Value], ‘Values’[Year] = SelectedYear)

 

Previous Year = VAR SelectedYear = SELECTEDVALUE(‘Values’[Year], BLANK()) - 1

RETURN

CALCULATE(SUM(‘Values’[Value], ‘Values’[Year] = SelectedYear)

 

I have placed both the measures on the Y-Axis with all the months checked on the filter pane but when the chart is being generated, its only plotting the values for Jan for both the years instead of plotting it for all the months for 2023. Any help regarding the same would be really appreciated. Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @BIUser1998 ,

 

I filled in the sample data and made up 24 years of data, and the result should be what you want, please check again.

vstephenmsft_1-1721373556189.png

And you can see below, there's no year field in Legend.

vstephenmsft_0-1721373484216.png

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @BIUser1998 ,

 

Thank you for reaching us. As far as I understand, you need a chart to show the year you currently selected, and the previous year. Then you should modify the measure to:

 

 

Previous Year = VAR SelectedYear = SELECTEDVALUE('Values'[Year], BLANK())-1

RETURN
CALCULATE(SUM('Values'[Value]),FILTER(ALLEXCEPT('Values','Values'[Month]),[Year]=SelectedYear))

 

vstephenmsft_2-1721281992699.png

 

You can download my attachment for more details.

 

Best Regards,

Stephen Tao

 

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

Hi @Anonymous , thank you for your reply.

 

I need it to look something like this

BIUser1998_1-1721309363426.png

Unfortunately, because I'm using data from other tables as well on this particular chart, I cannot just drag the Year field into legend to get a breakdown of year which is why I'm resorting to creating two measures with the data available. Thank you for your help

Anonymous
Not applicable

Hi @BIUser1998 ,

 

I filled in the sample data and made up 24 years of data, and the result should be what you want, please check again.

vstephenmsft_1-1721373556189.png

And you can see below, there's no year field in Legend.

vstephenmsft_0-1721373484216.png

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors