Forum Discussion
Adding Milestone flags into Line chart in power Bi
- Anonymous8 months ago
Hi bnadir55 ,
Thank you for reaching out to the Microsoft Fabric Community Forum and for sharing the screenshot. Also thank you burakkaragoz and GrowthNatives for your helpful response.
The behavior you're seeing is expected and helps identify the root cause. The milestone diamonds are appearing on incorrect or multiple dates because the milestone logic isn't linked to the current X-axis date. Power BI detects that a milestone exists in the data, but not specifically on the plotted date.
This occurs because the line chart uses a continuous Date axis from the calendar table, while milestone data comes from the Tasks table. If the DAX doesn't check that Finish_Date matches the axis date, Power BI shows the marker across multiple dates.
To resolve this, the milestone measure should only return a value when the finish date matches the X-axis date, returning BLANK otherwise. This keeps milestones aligned with the S-curve.
After making these changes, you should see one diamond per milestone, placed on the correct finish date, and aligned with the S-curve. Also, make sure the X-axis uses the Calendar[Date] column, is set to Continuous, and there's an active relationship between Calendar[Date] and Tasks[Finish_Date]. This will ensure milestones display correctly.
Thank you.
Hi bnadir55 ,
The reason your markers are "not in the right positions" is likely because you are trying to combine two different granularities (Continuous Dates for the S-Curve vs. Discrete Dates for Milestones) on a chart type (Combo Chart) that separates them into different axis contexts.
The most robust way to fix this and guarantee perfect alignment is to stay inside a standard Line Chart and use the "Ghost Line" technique.
Here is how to do it without changing your visual type:
1. The DAX (Create the "Ghost" Measure) You need a measure that returns a value only on the dates where a Milestone exists, and BLANK() everywhere else. This ensures it aligns perfectly with your X-Axis Date context.
Milestone Marker =
VAR CurrentMilestone =
CALCULATE(
MAX('Tasks'[Name]),
KEEPFILTERS(CONTAINSSTRING('Tasks'[Name], "MS"))
)
RETURN
-- Only return a position if a Milestone exists on this date
IF(
NOT(ISBLANK(CurrentMilestone)),
[Your Cumulative Progress Measure], -- This puts the diamond ON the S-Curve line
BLANK()
)Note: If you want the diamonds floating at a fixed height (like 30%), replace [Your Cumulative Progress Measure] with 0.3.
2. The Visual Setup (The Secret Sauce)
Add this [Milestone Marker] measure to your Y-Axis (alongside your Plan and Actual lines).
Go to Format Pane -> Lines.
Select the Series: Milestone Marker.
Set Stroke Width to 0 px. (This makes the line invisible).
Go to Markers.
Select Series: Milestone Marker.
Turn Markers On.
Choose Shape: Diamond, Size: 10, Color: Orange.
3. The Labels (Getting the "MS1" Text) To show "MS1", "MS2" next to the diamond:
Turn on Data Labels for the Milestone Marker series.
Expand the Values section inside Data Labels.
Use the "Field" option (Dynamic Labels).
Select your 'Tasks'[Name] column (or a measure that returns the Milestone Name).
This method forces the Milestones to share the exact same X-Axis (Date) as your S-Curve, solving the misalignment issue instantly.
Hope this helps you build that perfect dashboard!
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
- bnadir558 months agoRegular Visitor
Thx! but did all you wrote in section 1 and 2 , and received unrequested behaviour :