Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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...
  • Fowmy's avatar
    Fowmy
    6 years ago

    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!