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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Fill Blanks with latest if based on sequence

Hello there,

 

I'm having some trouble on solving this one. 

To give a breif example, we have a sequence from 1 - 5 each with a status and date. Sometimes the user skips this sequence and now I'd like to fill the gap with the latest date available.

 

Example

IDStatusStatusIDLatestDate
025755Intial Lead1Jan 1 2021
025755Regular Lead2Jan 5 2021
025755Hot Lead3To be filled
025755Signature Pending4To be filled
025755Success5Jan 25 2021

 

 

Example2

IDStatusStatusIDLatestDate
025755Intial Lead1Jan 1 2021
025755Regular Lead2To be filled
025755Hot Lead314 Jan 2021
025755Signature Pending4 
025755Success5 

Now as you can see we have 2 statuses in example 1 that were skipped and thus have no dates. My objective is to fill these blank spaces for each group(ID) with the latest date available based on the max status/statusID.

 

In example 2, 1 status was skipped and the latest current Id is 3, so we only need to fill the one in between. 


By default, status(ID) 1 always has a date.

 

mhdaiman23_0-1632034225459.png

 

Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , a new column

 

column =

var _max = maxx(filter(Table,[ID] = earlier([ID]) && not(isblank([Latest Date]))  ) ,[Latest Date])

return

if(isblank([Latest Date]), _max, [Latest Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , a new column

 

column =

var _max = maxx(filter(Table,[ID] = earlier([ID]) && not(isblank([Latest Date]))  ) ,[Latest Date])

return

if(isblank([Latest Date]), _max, [Latest Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi there @amitchandak 

 

Thank you so much, this actually worked to do what I require. I'm still new to PBI, and still finding my way around working with row context. 

 

Could you breifly explain the logic of compare with earlier ID?

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.

Top Solution Authors