Forum Discussion
problem with line graph for continuous totals
Hi,
I've created a line graph to plot cumulative percent totals for people recruited to a committee across weeks but am running into an issue. I first created a calendar table to use to plot the data by week:
The problem is that the cumulative total does not stop at the last data point for this particular committee which should be in March 2025 and instead runs until the last date in the entire data set for all committees (July 2025).
I updated the cumulative total measure to incorporate a filter using the last date with values:
Is there a way to fix this and have the lines continuous as in the first chart but the x-axis align to the correct range as in the second graph?
Thank you to everyone who posted suggestions. I was able to determine that the issue that was causing the problem (gaps in lines) was due to using a weekmin date function (CALCULATE(MINX('Calendar','Calendar'[Date]),ALLEXCEPT('Calendar','Calendar'[Week Number]))) to graph my data on the x-axis. Power BI viewed this as a categorical value and gaps were created in my data as a result. When I changed the x-axis to continuous and instead used 'Date' from the Calendar table as the x-axis field the lines in the visual were presented without gaps over the correct timespan. I wasn't able to have the data presented weekly on the x-axis (it is presented monthly instead) but that is a small tradeoff I can live with.
Below is the result when the x-axis is continuous and Date is used from the calendar table: