Forum Discussion
Cropped Graph (Line Graph)
Hello everyone
- DATE (type Date, e.g. "02/04/2025")
- TIME (type Time, e.g., "00:00:00")
- Consumo_Energia (numerical values)
- Refrigerator (refrigerator brand LG, SAMSUNG,MABE, ETC),
Three options for you >
I have created a video on this as well https://youtu.be/n6kEXZjQ5f0
Enhancing Data Representation in Power BI Line Charts
Categorical X-Axis for Controlled Spacing – Switching the X-axis type from Continuous to Categorical ensures missing dates don’t get connected. However, this method spaces out all dates equally, making it less obvious when gaps exist in the dataset.
Use a Column Chart for Visible Gaps – If showcasing gaps is important, opt for a Column Chart, which naturally displays missing data points. If a trend line is still needed, the Line and Stacked Column Chart can be used. Adjust the Default Column Color to something subtle, ensuring missing data is visually distinguishable while keeping the trend intact.
Handle Null Values in Measures Carefully – Setting a measure to return 0 for nulls forces data points onto the axis, but this might create misleading results if real zero values exist. To distinguish true data gaps, consider using -1 instead (assuming negative values don’t naturally occur), ensuring gaps align properly with the axis without affecting actual metrics.
This solution is the best one > Solved: Line graph draws line even when there's no data - Microsoft Fabric Community
Regards,
Ritesh
Community Champion
Please mark the answer if helpful so that it can help others
Hi Syndicate_Admin ,
Thank you for providing such a clear and helpful explanation ribisht17 .
- Using a Categorical X Axis to prevent the line from connecting over missing dates
- Switching to a Column Chart to make those gaps more noticeable
- Handling null values in measures by using something like -1 to identify real data gaps without confusing them with actual zeros.
Could you confirm if ribisht17 , solution worked for you? If it did, please mark the answer as 'Accept as Solution' so others with similar queries can find it more easily. If not, please share the details.
Thank you for your response danextian & Deku .
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.
7 Replies
- V-yubandi-msftCommunity Support
Hi Syndicate_Admin ,
Thank you for providing such a clear and helpful explanation ribisht17 .
- Using a Categorical X Axis to prevent the line from connecting over missing dates
- Switching to a Column Chart to make those gaps more noticeable
- Handling null values in measures by using something like -1 to identify real data gaps without confusing them with actual zeros.
Could you confirm if ribisht17 , solution worked for you? If it did, please mark the answer as 'Accept as Solution' so others with similar queries can find it more easily. If not, please share the details.
Thank you for your response danextian & Deku .
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.
- DekuSuper User
You could have two separate lines, one for each period. You could either define each period in a column and add to the legend. Or can create a measure for each period.
- danextianSuper User
You will need to set your x-axis to Categorical. If you use Continuous, Power BI will try to fill in the gaps even when some dates are missing.
- ribisht17Super User
Three options for you >
I have created a video on this as well https://youtu.be/n6kEXZjQ5f0
Enhancing Data Representation in Power BI Line Charts
Categorical X-Axis for Controlled Spacing – Switching the X-axis type from Continuous to Categorical ensures missing dates don’t get connected. However, this method spaces out all dates equally, making it less obvious when gaps exist in the dataset.
Use a Column Chart for Visible Gaps – If showcasing gaps is important, opt for a Column Chart, which naturally displays missing data points. If a trend line is still needed, the Line and Stacked Column Chart can be used. Adjust the Default Column Color to something subtle, ensuring missing data is visually distinguishable while keeping the trend intact.
Handle Null Values in Measures Carefully – Setting a measure to return 0 for nulls forces data points onto the axis, but this might create misleading results if real zero values exist. To distinguish true data gaps, consider using -1 instead (assuming negative values don’t naturally occur), ensuring gaps align properly with the axis without affecting actual metrics.
This solution is the best one > Solved: Line graph draws line even when there's no data - Microsoft Fabric Community
Regards,
Ritesh
Community Champion
Please mark the answer if helpful so that it can help others
- V-yubandi-msftCommunity Support
Hi Syndicate_Admin ,
Has your issue been resolved, or do you require any further information? Your feedback is valuable to us. If the solution was effective, please mark it as 'Accepted Solution' to assist other community members experiencing the same issue.
- V-yubandi-msftCommunity Support
Hi Syndicate_Admin ,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you. - V-yubandi-msftCommunity Support
Hi Syndicate_Admin ,
Could you let us know if your issue has been resolved or if you are still experiencing difficulties? Your feedback is valuable to the community and can help others facing similar problems.
Thank You.