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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
asehenderson
Frequent Visitor

Fill in Missing Dates for Multiple Rows

Hi all,

 

I've got a dataset that has four variables that serve as slicers (location, employee type, status1, and status2) by date. Our data system does not create rows for days with zero reports, so my dataset is some missing dates. I've incorporated a date table in Power BI and merged that into the original file so all dates in the range appear in my line chart, with zeros for the blank days.
I need these daily zero counts  to appear on the chart regardless of the combination of slicer values selected. But, since there is no location, employee type, etc. attributed to these rows, the values on the line chart disappear when I click on the slicer selections. How can I make the zeros show for all permutations of slicer selections?

 

Here is the basic design of the report and source data layout. 

 

pbix pic.PNGexcel pic.PNG

 

The PBIX and sample source data are here.

 

Any guidance would be greatly appreciated!

3 REPLIES 3
Greg_Deckler
Super User
Super User

@asehenderson - So generally you handle that like this:

 

Measure = 
  VAR __Calc = <some calculation goes here>
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...

@Greg_Deckler 

 

Thank you. I tried the measure as suggested and it does not seem to work if any of the slicers are used. If no slicers values are selected, the zero dates appear fine. But when I click on a slicer value, the zero count days disappear, since there is nothing in the zero day data row to correspond to the slicer values of location, type, etc. values being filtered on.

@asehenderson - It sounds like you might want to be using a disconnected table for your slicer. If you do that, then you have much more control over what gets displayed and what does not get displayed.



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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors