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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PBI_newuser
Post Prodigy
Post Prodigy

Power Query: how to create missing date

Hi,

I want to fill in the missing [Assigned Date].

 

How to create the [Assigned Date] with the below criteria:

 

If there is no [Assigned Date], then use [Created Date],

but if the [Created Date] is after [Onsite Date],

then use [Onsite Date] as [Assigned Date].

 

Assigned DateCreated DateOnsite Date
2/27/20202/26/202010/13/2020
-9/2/20209/8/2020
-9/12/20209/5/2020
1 ACCEPTED SOLUTION

Hi @PBI_newuser ,

 

May be modify the condition as follows and the try:

NewCol = IF([Assigned Date] = BLANK() && [Created Date] < [Onsite Date], [Created Date],

IF([Assigned Date] = BLANK() && [Created Date] > [Onsite Date], [Onsite Date],  [Assigned Date]))

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You can do this in DAX by creating a new table with all of the dates in your range as follows: FullTable = ADDCOLUMNS( CALENDAR(MIN(Table1[Date]), MAX(Table1[Date])), "Quantity", LOOKUPVALUE( Table1[Quantity], Table1[Date], MAXX( FILTER(Table1, Table1[Date] <= EARLIER([Date])), [Date] ) ) )

 

The CALENDAR function gives you a range of dates from you minimum to maximum dates in your original table. From there, we add a new column, Quantity, and define it as the value we get when looking up the Quantity in the original table for the date that was the maximum date occurring on or before the date in the current row.

Pragati11
Super User
Super User

Hi @PBI_newuser ,

 

You can create a calculated column using the DAX below:

NewCol = IF([Assigned Date] = BLANK(), [Created Date], IF([Created Date] > [Onsite Date], [Onsite Date],  [Assigned Date]))

 

Just make sure all the columns are in DATE format.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11 ,

It doesn't work. 

PBI_newuser_0-1603891106747.png

 

Hi @PBI_newuser ,

 

May be modify the condition as follows and the try:

NewCol = IF([Assigned Date] = BLANK() && [Created Date] < [Onsite Date], [Created Date],

IF([Assigned Date] = BLANK() && [Created Date] > [Onsite Date], [Onsite Date],  [Assigned Date]))

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors