Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Syndicate_Admin
Administrator
Administrator

Cropped Graph (Line Graph)

Hello everyone

Am laboring in one graphic of lines in Power BI y Need help for avoid what the line Connect Of Periods of data when there's one rank of Dates without data. A continuation Detail Is it problem:
I have a chart called Energy with the following relevant columns:
  • 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),
My goal is to create a line graph that shows the average of consumo_energia by DATE_TIME (a combination of DATE y TIME), I have dates from March 19, 2025 from 6:00 PM to April 28 at 5:00 PM. The important thing is that I don't have the dates from my source Excel file between April 2nd and April 15th. That's why when I graph I get a straight line that connects the dates where there is no data, I don't want it to appear that way but to go continuously. (Obviously the X axis is selected in continuous but I still get this line).
Thank you for the support.
Example of how to connect the dates that I don't have in my source file:
1000044274.jpg

2 ACCEPTED SOLUTIONS
ribisht17
Super User
Super User

Hi @Syndicate_Admin 

 

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

  1. 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. 

    ribisht17_1-1746380847874.png

     

ribisht17_0-1746380791684.png

 

  1. 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.

ribisht17_2-1746381002512.png

 

 

 

  1. 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

Dance-Sing with Data Projects - YouTube

View solution in original post

V-yubandi-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

Thank you for providing such a clear and helpful explanation @ribisht17 . 

  1. Using a Categorical X Axis to prevent the line from connecting over missing dates
  2. Switching to a Column Chart to make those gaps more noticeable
  3. 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.

 

View solution in original post

7 REPLIES 7
V-yubandi-msft
Community Support
Community 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.

V-yubandi-msft
Community Support
Community 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-msft
Community Support
Community 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-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

Thank you for providing such a clear and helpful explanation @ribisht17 . 

  1. Using a Categorical X Axis to prevent the line from connecting over missing dates
  2. Switching to a Column Chart to make those gaps more noticeable
  3. 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.

 

ribisht17
Super User
Super User

Hi @Syndicate_Admin 

 

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

  1. 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. 

    ribisht17_1-1746380847874.png

     

ribisht17_0-1746380791684.png

 

  1. 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.

ribisht17_2-1746381002512.png

 

 

 

  1. 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

Dance-Sing with Data Projects - YouTube

danextian
Super User
Super 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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Deku
Super User
Super 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.


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.