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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
pat1214
Frequent Visitor

Flat sparkline if no data exists

Hello,

 

I am building a dashboard which consists of different metrics. Most of them have data for past two years, except for three metrics that have data for the past 8 months only. One of the displays on the dashboard is a sparkline visual which shows a 13 month trend. I have attached a snapshot of two metrics as an example. The end user wants the months for which there is no data to be flat instead of starting from July 2018. There is no data available for the metric before Jul 2018 in the underlying data model either. I am not sure how to solve this. Should this be taken care of in the data model / underlying table (for example, inserting NULL values for the missing months) or in the dashboard in PowerBI? Any help is greatly appreciated. This is my first project using a visualization tool and I could really use some direction. Thank you!

 

sparkline.JPG

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @pat1214 ,

 

Here you should create a calendar table using the formula like table = CALENDARAUTO() and create relationship between it and your fact tables. Then you can add the date column in calendar table in your visual to work on it.

 

Regards,

Frank

 
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hello,

 

Thank you for the reply. I should have mentioned in my original post that there is a column called 'Reporting Period' in the staged table that populates the dashboard. I have attached a picture of it below as an example. 15 and 16 are metric ids. Metric 15 for example has data all the way from Oct 2016 to January 2019, but Metric 16 has data from Oct 2016 to Aug 2018. So in the sparkline visual, I am trying to get a flat line for months Sept 2018 to Jan 2019. Will inserting 'Null' for the missing values in the staged table help in achieving it? Thank you!

 

 

metric.JPG

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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