I'm trying to create a line chart in Power BI to visualize the number of bugs created and resolved over time. My dataset includes a list of bugs with Created Date and Resolved Date fields.
I want the chart to look like this (example from Excel):
But it plots only like this? What I am missing? How to get Week1, Week2....?
Update
As suggested DataTable
is created
Added the Visualization
But graph is not showing any data!
Few more Updates
I'm trying to create a line chart in Power BI to visualize the number of bugs created and resolved over time. My dataset includes a list of bugs with Created Date and Resolved Date fields.
I want the chart to look like this (example from Excel):
But it plots only like this? What I am missing? How to get Week1, Week2....?
Update
As suggested DataTable
is created
Added the Visualization
But graph is not showing any data!
Few more Updates
If you don't already have a date table, create one using DAX. This helps group your data by week. Go to Modeling > New Table (I tried to read the column names based on your screenshot, but maybe you have to adjust them):
DateTable = ADDCOLUMNS(
CALENDAR(MIN(BugData[Created Date]), MAX(BugData[Resolved Date])),
"YearWeek", FORMAT([Date], "YYYY \Week ") & FORMAT(WEEKNUM([Date]), "00")
)
This creates a continuous date range from the earliest created bug to the latest resolved bug. After that, relate the DateTable with your bug table.
Once the DateTable is connected, create two DAX measures:
Measure 1: count of bugs created per week
Bugs_Created_Week =
VAR CurrentWeek = SELECTEDVALUE(DateTable[YearWeek])
RETURN CALCULATE(
COUNT(BugData[Work Item ID]),
FILTER(BugData, BugData[Created Date] IN VALUES(DateTable[Date]))
)
Measure 2: count of bugs resolved per week
Bugs_Resolved_Week =
VAR CurrentWeek = SELECTEDVALUE(DateTable[YearWeek])
RETURN CALCULATE(
COUNT(BugData[Work Item ID]),
FILTER(BugData, BugData[Resolved Date] IN VALUES(DateTable[Date]))
)
After that, update your Power BI line chart