Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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?
Many thanks for the support.
Solved! Go to Solution.
@Marico ,
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:
Resident Rockstar | Former Super User If I helped, please accept the solution and give kudos! Connect with me |
This isn't working for me. Could you please provide another solution? @lkalawski
@Marico ,
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:
Resident Rockstar | Former Super User If I helped, please accept the solution and give kudos! Connect with me |
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.
Resident Rockstar | Former Super User If I helped, please accept the solution and give kudos! Connect with me |
Check out the March 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
92 | |
64 | |
56 | |
46 | |
45 |