Introduction
This week’s challenge was inspired by Bas. We are creating a Timeline Visual using the Line Chart and measure-driven data labels.
For this project timeline, we will be adding a today line, highlighting completed milestones, and milestones that are off-track. We will be adding descriptors to the milestones and truncating the descriptors to a certain character length to keep the visual tidy. Full descriptions of milestones are presented in tooltips.
Requirements
- Obtain the source data via link below
- In Power Query, add Index column
- Create a Custom Column which transforms the even index numbers to negative numbers
HINT: each if Number.IsEven([Index] ) then 0-[Index] else [Index]
- Duplicate the Project Milestones field, extract the first 40 characters and add “…” text
Graph 1
- Create a measure for the baseline markers, where baseline = 1
- Create a measure for the Custom Index field
- Add the Line Chart visual to the canvas, place date in the X-Axis, Baseline measure and Custom Index measure to the Y-Axis
- Place Project Milestone description in the tooltips field well
- Format the Custom Index measure to have line width of zero, square markers. Format Baseline line to be 1px and round markers
- Format the Custom Index measure to have line width of zero, square markers. Format Baseline line to be 1px and round markers
- Under the Analytics formatting options, enable data bars and set upper bound to Custom Index measure
- Under Data Labels formatting options, enable Custom Labels for the Custom Index measure only, using the shortened project timeline descriptions. Set the position of the labels to “Above”
- Enable Zoom sliders and remove the Y-Axis labels
Graph 2
- Complete Graph 1
- Create a measure returning todays date
- Under the Analytics formatting options, add an X-Axis constant line at today’s date (use the measure fx)
- Add shading
- Add today’s date as a data label for the constant line
Graph 3
- Complete Graph 2
- Create measures for Baseline markers and callout markers that are filtered on KPI colour e.g. Callout Red = CALCULATE(SUM(‘Timeline Data'[Custom Index]), ‘Timeline Data'[KPI]=”Red”)
- Add these measures to the fields well
- Format these measures with line = 0px, markers coloured according to KPI colour, no data labels.
Dataset
This week’s data can be found at Github : Workout-Wednesday-2023/WoWTimelineData.xlsx at main · kolky001/Workout-Wednesday-2023 · GitHub
Share
After you finish your workout, share on Twitter using the hashtags #WOW2023 and #PowerBI, and tag @MMarie, @shan_gsd, @KerryKolosko. Also make sure to fill out the Submission Tracker so that we can count you as a participant this week in order to track our participation throughout the year.
Solution
Solution File available for download via Data Stories Gallery.
Coming soon!
hi ,
i could not get around how to get this straight line from point to baseline !!!
regards
J khan