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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Fill blank values with previous value

Hi ,

 

I m new to power bi ,I have below dataset. In Target 2 column , blank values filled with previous value.Please help me to write dax  for same.

 

Year-Week      TARGET        TARGET2  
2020-25      14112   14112
2020-26    14112
2020-27     10872   10872
2020-28   10872
2020-29   10872
2020-30     8928   8928

 

Thanks

 

 

1 ACCEPTED SOLUTION

@Anonymous 

 

You can use the below Measure, I only changed the EARLIER function to MAX.

Measure_Filldown  =
VAR LNBT = 
    CALCULATE(MAX('Table'[YEAR-WEEK]),
    FILTER(
        ALL('Table'),
        'Table'[YEAR-WEEK]<=MAX('Table'[YEAR-WEEK]) && 'Table'[TARGET]<>BLANK()
    )
    )
RETURN
CALCULATE(
    MAX([TARGET]),
    'Table'[YEAR-WEEK] = LNBT ,ALL('Table')
)


Did I answer your question? Mark my post as a solution!

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

11 REPLIES 11

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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