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
nikcus
Regular Visitor

Year to date line chart for each year with a label for the last year only

Hi, can anyone please help me with this? 
I started working on a year to date line chart for 5 years. Each line would be 1 year. I managed to do that following this video on youtube.

nikcus_0-1641901950557.png

Then I wanted to turn on the labels but only for the last year. When I turned on the labels, they were for each year. I searched how to turn on only the last label and found the following video

nikcus_1-1641902049148.png

However I cannot figure out how to combine these 2 processes in order to get the final result. Can anyone please help? Thank you

 

4 REPLIES 4
DataZoe
Microsoft Employee
Microsoft Employee

@nikcus One way you can do this is to incorporate a contant Y-axis line and set it to your Lastest Population measure:

DataZoe_0-1641922036430.png

DataZoe_1-1641922101066.png

DataZoe_2-1641922144916.png

 

You can make the line transparent so only the label shows.

 

I've attached the PBIX so you can see what I did too.

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Hi Zoe, thank you so much for suggested solution! But does it mean that I need to create a separate measure to get a value for each year and then add it to the Y-axis constant line? I created a measure that shows the cumsum at the end of the year, for the rest of the year it is blank values. When I throw that measure into the Values in Y-axis Constant Line, it gives me a 0, instead of the values in the column "test" as you can see attached in the screenshot. I hope I described it in an understandable way... 

nikcus_0-1641929926006.pngnikcus_1-1641929938998.png

 

DataZoe
Microsoft Employee
Microsoft Employee

@nikcus are you able to share your test measure?

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Yes, here it is: 

CumsumMax =
VAR lastedate =
ENDOFYEAR(Projects[CreatedDate])

VAR temp =
CALCULATE(
MAX(Projects[ProjectsCumSum]),
FILTER(
ALLSELECTED(Projects),
Projects[CreatedDate] = lastedate
)
)

RETURN
IF(
SELECTEDVALUE(Projects[CreatedDate]) = lastedate,
temp,
BLANK()
)
Its quite simple, basically what it does is if the date is not the last day of the year, show blank, if the day is the last day of the year, give me a cumsum of the year.
nikcus_0-1641931534678.png

 

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.