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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Zepox
Frequent Visitor

Fill missing dates with 0's and empty cells

Hello all,

 

I have a sample table which countains 4 columns; Name, Date, Steps and Terrain. Not every name has data on each date, and I want to fill those missing dates. I want to fill the Steps column with 0 and want to leave the Terrain column empty (null value). In this sample Peter contains all dates in the dataset but ideally I want to fill based on the min and max Date value. I have come across several solutions which come close but I can't quite manage to get them to work for my situation. Below are examples of my data and the desired result:

Zepox_0-1654766139564.pngZepox_1-1654766151858.png

 

 

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Zepox Try these steps:

Step 1: Create a new calendar table using DAX

Calendar = CALENDAR(MIN('Step Table'[Date]),MAX('Step Table'[Date]))
 
Step 2: Join date of this calendar table with Step table's date column
1.JPG

 

 Step 3: Create a measure in Calendar table:

Steps Measure = SUM('Step Table'[Steps])+0
 
Step 4: Create an another measure for Terrain in the same Calendar table
Terrain = IF(ISBLANK(MAX('Step Table'[Terrain])),BLANK(),MAX('Step Table'[Terrain]))
 
Step 5: Final Output 
4.JPG

 

 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

2 REPLIES 2
Tahreem24
Super User
Super User

@Zepox Try these steps:

Step 1: Create a new calendar table using DAX

Calendar = CALENDAR(MIN('Step Table'[Date]),MAX('Step Table'[Date]))
 
Step 2: Join date of this calendar table with Step table's date column
1.JPG

 

 Step 3: Create a measure in Calendar table:

Steps Measure = SUM('Step Table'[Steps])+0
 
Step 4: Create an another measure for Terrain in the same Calendar table
Terrain = IF(ISBLANK(MAX('Step Table'[Terrain])),BLANK(),MAX('Step Table'[Terrain]))
 
Step 5: Final Output 
4.JPG

 

 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Thank you for your reply, this works as intended and translates to my actual data very well.

 

I still have some issues trying to make calculations based on the generated data, but I will figure those out along the way. Thanks again!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.