Forum Discussion
Cumulative line chart with multiple legends is cut
Hello!
I have a line chart placed in front of a scatter plot. The line chart represents the cumulative sum of values. The issue is that when there's no value for a specific legend item, the line is cut off instead of continuing as a flat line. How can I achieve a continuous line behavior in the graph below?
- Anonymous1 year ago
Hi julsr ,
Thank you for reaching out to the Microsoft Fabric Community Forum.
The issue you're seeing where cumulative lines break when data is missing for a legend item is due to gaps in the data model. Power BI's line chart requires a value for each date-legend combination to maintain line continuity.
To resolve this, you have the following options:
Create a measure that carries forward the last known cumulative value even when no new data exists. Also, ensure your dataset includes all date and legend combinations, using a disconnected date table or cross-join if needed.
Use Deneb visual as lbendlin suggested, it allows full control over visual behavior using Vega/Vega-Lite, where you can overlay line and scatter marks and explicitly handle nulls.
I hope this will resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
3 Replies
- lbendlin
Super User
consider using a visual like Deneb where you can overlay multiple marks.
- AnonymousNot applicable
Hi julsr ,
Thank you for reaching out to the Microsoft Fabric Community Forum.
The issue you're seeing where cumulative lines break when data is missing for a legend item is due to gaps in the data model. Power BI's line chart requires a value for each date-legend combination to maintain line continuity.
To resolve this, you have the following options:
Create a measure that carries forward the last known cumulative value even when no new data exists. Also, ensure your dataset includes all date and legend combinations, using a disconnected date table or cross-join if needed.
Use Deneb visual as lbendlin suggested, it allows full control over visual behavior using Vega/Vega-Lite, where you can overlay line and scatter marks and explicitly handle nulls.
I hope this will resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.