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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ms92ita
Helper I
Helper I

line chart with dates and missing data

Hi,

 

I am getting some troubles on a report with direct query connection from a SQL server.
In this report i have a slicer of dates (between) and some charts/counters. Specifically I have a line chart that has no data in the highlighted part in the following screenshot:

ms92ita_0-1668173302954.png

 

The correct value would be 0 if not exists, but the line is continuous and this is not correct.
Creating a table with continuous dates and values is not an option because these graphs will be available for many customers from the same DB, so in a SQL server side the size would be big. Is there another mode or free graph that removes this error on a timeline?

7 REPLIES 7
ms92ita
Helper I
Helper I

ms92ita_0-1668174208360.png

As you can see, the granularity is per day and not aggregated... The visual is for a year.

negi007
Community Champion
Community Champion

@ms92ita can you share your pbix file or sample data in table format which can be copied




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



Proud to be a Super User!


Follow me on linkedin

PBIX is a bit complex to export beacuase the the chart a little part of a bigger report and I do not know how to export data from a calculated table. Anyway, the structure of the source data for time line is this:

ms92ita_1-1668175761258.png



X axis is date, while Items and TotalItems are line values

Another example is from FirstDate and LastDate as y-axis:

ms92ita_2-1668175853268.png

 

 

 

Hi @ms92ita

 

Please create the following measures for Items and TotalItems. They will return 0 for blank values. Use these measures for line values to replace the original columns. 

M_Items = SUM ( 'TableName'[Items] ) + 0
M_TotalItems = SUM ( 'TableName'[TotalItems] ) + 0

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hi @v-jingzhang 

 

An additional measure is not the solution because the original table does not have a "continuous" value for dates, so in the summarization some dates would miss for sure.
Since that a table with continuous values for all customers will be massive and not optimized, can I link a "table" to a stored procedure that gets data from filters that I will send like customerid and min/max dates selected from a range? With that, from the database I can recreate a continuous time series.

Hi @ms92ita 

 

To have a continuous date series, you can add a Date table. A simple method is to use DAX function Calendar. Then build a relationship between Date table and Fact table on Date column. Use Date table's Date column on X-axis of the line chart. This could make the X-axis have all continuous dates. And on the dates that are missing in Fact table, the measures with "+ 0" will return 0. 

 

The following articles explain why you need a Date table and how to create a Date table with DAX:

Do You Need a Date Dimension? - RADACAD

Creating a simple date table in DAX - SQLBI

Creating a simpler and chart-friendly Date table in Power BI - SQLBI

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

negi007
Community Champion
Community Champion

@ms92ita 

It seems values are aggregating at month level. Please try to drill down one more level to date level




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



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors