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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
stalerik
Helper II
Helper II

Always Show Last 24 Hours on Line Chart When Data Starts with NULLS

Hello,

 

I am making a line chart on a continous time-based axis.  I am using the relative time filter to show only the data in the last 24 houts.  When the range starts with NULL values, my x-axis does not go back the full 24 hours.   Instead, it only goes back to the first value and starts the chart from there.  For example, if I have 3 hours of NULL values to start my last 24 houts, then the x-axis only shows the last 21 hours.  How can I make the x-axis always show the full 24 hours even if the daa occasionally starts with NULL values?  I have selected the option to "show items with no data" but that didn't do anything.

 

Thnaks!

1 ACCEPTED SOLUTION

Hi @stalerik ,

 

The tpye of the X axis should be 'Categorical' and enable 'Show items with no data'.

v-lionel-msft_0-1599461982982.png

v-lionel-msft_0-1599462156976.png

 

v-lionel-msft_1-1599462182466.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@stalerik , You can add +0 to your measure, that will create left join.

Greg_Deckler
Super User
Super User

@stalerik Generally you do that like this:

Measure =
  VAR __Calc = <some calculation>
RETURN
  IF(ISBLANK(__Calc),0,__Calc)

Alternatively:

Measure =
  VAR __Calc = <some calculation>
RETURN
  __Calc + 0

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you for this information.  The new measure converts all the NULLS to zeros and then puts the zeros on the chart.  This does extend the x-axis to the full 24 hours but now it shows zeros on the line chart.  Is there another way to show the full 24 hours on the x-axis but leave the NULL values as missing on the chart and tooltip?  I don't want to give the impression that an actual zero value is in the data, but instead show the values as missing (gap).

Hi @stalerik ,

 

The tpye of the X axis should be 'Categorical' and enable 'Show items with no data'.

v-lionel-msft_0-1599461982982.png

v-lionel-msft_0-1599462156976.png

 

v-lionel-msft_1-1599462182466.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

tex628
Community Champion
Community Champion

I've got a little workaround for this, but it's quite bad since i cant figure out how to fix the tooltip 🙂 

But if you're fine with removing the tooltip and using datalabels instead it should work quite well! 

See the attached file. 

/ J


Connect on LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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