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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Marico
Helper III
Helper III

Text label for different points of a line graph

As shown in below picture, I have a requirement to show different labels for green and black highlighted data points of the line graph. 

 

The black point is the for reference max date in the dataset (even if it is not end of the month) and other remaining points in green are the last day of the month. any solution for this?

 

Marico_0-1733402928293.png

 

Many thanks for the support.

1 ACCEPTED SOLUTION

@Marico ,

lkalawski_0-1733480094889.png

With such a table, all you need to do is write two additional measures - one to show the markers and data labels for the last days of the month:

LastDaysInTheMonth Label = 
VAR __LastDayInDataset = CALCULATE(MAX('Table'[Date]), ALL('Table'))

RETURN
    IF(MAX('Table'[Date]) = __LastDayInDataset, BLANK(), Sum('Table'[Value]))

and a second measure that shows the marker and data label for the maximum date in the entire dataset:

LastDayInDataset Label = 
VAR __LastDayInDataset = CALCULATE(MAX('Table'[Date]), ALL('Table'))

RETURN
    IF(MAX('Table'[Date]) = __LastDayInDataset, Sum('Table'[Value]), BLANK())

Then create a line chart - add a main measure to show one line for all values. For this measure disable marker and data labels and add the other two measures (above) and disable showing lines for them.

Then you can customize the colors for markers and data labels.

 

Result:

lkalawski_1-1733480309102.png

 

PBI_SuperUser_Rank@1x.pngResident Rockstar | Former Super User
If I helped, please accept the solution and give kudos! 
Connect with me
Linkedin

 

View solution in original post

3 REPLIES 3
Marico
Helper III
Helper III

This isn't working for me. Could you please provide another solution? @lkalawski 

@Marico ,

lkalawski_0-1733480094889.png

With such a table, all you need to do is write two additional measures - one to show the markers and data labels for the last days of the month:

LastDaysInTheMonth Label = 
VAR __LastDayInDataset = CALCULATE(MAX('Table'[Date]), ALL('Table'))

RETURN
    IF(MAX('Table'[Date]) = __LastDayInDataset, BLANK(), Sum('Table'[Value]))

and a second measure that shows the marker and data label for the maximum date in the entire dataset:

LastDayInDataset Label = 
VAR __LastDayInDataset = CALCULATE(MAX('Table'[Date]), ALL('Table'))

RETURN
    IF(MAX('Table'[Date]) = __LastDayInDataset, Sum('Table'[Value]), BLANK())

Then create a line chart - add a main measure to show one line for all values. For this measure disable marker and data labels and add the other two measures (above) and disable showing lines for them.

Then you can customize the colors for markers and data labels.

 

Result:

lkalawski_1-1733480309102.png

 

PBI_SuperUser_Rank@1x.pngResident Rockstar | Former Super User
If I helped, please accept the solution and give kudos! 
Connect with me
Linkedin

 

lkalawski
Super User
Super User

Hi @Marico ,

 

To show two types of labels, the easiest way is to write two measures, one that will show data at the end of the month, and the other that will show only one label at the end of the period.

Just add these two measures to the line chart, then turn off the lines for them and turn on the data labels.

The third line can be the overall result and for that you should turn off the data labels.

 

PBI_SuperUser_Rank@1x.pngResident Rockstar | Former Super User
If I helped, please accept the solution and give kudos! 
Connect with me
Linkedin

 

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors