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
Anonymous
Not applicable

I trying to populate my table or axis with period even though there are gaps

 
 
 

I am trying to populate my table with a date or period even though is no data so my graph runs continuously along its axis.  I came across an artcile below but I seemed to get a mixed results, mainly due on my part most likely.  

xreference:  Show-dates-with-no-data-on-continuous-date-axis

 

This is a sample graph, you will notice for 2019 Q2 and Q3 are missing, and again for 2020 we are now in Q4 but no axis details.  The actrual raw data is processed through powerquery, what you see here is just one of the 3 data sources, this one is easier to see the gaps on the chart.  All 3 tabels look at a calendar I created, and each table has an "ApplicationDate" which points to the date field on my calendar.  My calendar date range covers early and future dates to capture all data; the 3 main data soures are refreshed periodically.

 

SampleGraphSampleGraph

 

 

This is my sample data: I have a measure that  just simple counts the value  which is then linked to the calenader against the "ApplicationDate" which is how I get the breakdown by Month and Quarter for each data type.  I am maybe needing to cover all date ranges in the calendar and any that are missing from my data soure are populated with a '0' in the "DataValue" column for each table.

 

Sample Data Type2

ApplicationDateDataTypeDataValue
02/05/2019Data21
29/10/2018Data21
27/09/2019Data21
27/09/2019Data21
03/10/2019Data21
18/11/2019Data21
18/11/2019Data21
08/11/2019Data21
22/10/2019Data21
28/02/2020Data21
28/02/2020Data21
09/04/2020Data21

 

Or am I over complicating this task?

 

many thanks

Chris

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous - Often you can get around this by doing something like:

 

Measure = 

  VAR __Calc = <some calculation>

RETURN

  IF(ISBLANK(__Calc),0,__Calc)



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , +0 to you measure

or try this option

ShowItemwithoutdata.JPG

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Amitchandak

 

Thats for this, definatley worth a look at but for now I think gregs answer seems to work a treat plus I like the idea of using DAX.

 

thanks again.

Chris

Greg_Deckler
Super User
Super User

@Anonymous - Often you can get around this by doing something like:

 

Measure = 

  VAR __Calc = <some calculation>

RETURN

  IF(ISBLANK(__Calc),0,__Calc)



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Greg

 

Thats is so simple, is the measure working through each row; row context, to carry-out the 'IF' statement?

 

see chart with forumla:

GraphLayout2.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

My actual formula is  - 

 

=VAR _CALC = COUNTA(Data2_nonWT[FieldName])
RETURN
IF(ISBLANK(_CALC), 0, _CALC)

 

I take it the fact I have the data2 table linked to the Calenader table (1-* relationship) must also playa key role? 

 

One other query, the red dots on the chart.  I can not seem to sort the Months right for 'Q2', the rest seem to fall into place, any thoughts on this?

 

 

Chris

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.