Power BI: fill blank cells with previous values
This article talks about how to put the previous value for blank cells like that:
![]() |
![]() |
The most important is to have a column with values that I can use to sort my data correctly so it can be an index column or a date column for instance. To create an index column, read Power BI: sort correctly with index/ranking.
Option 1: calculated column
For a column, click on:
Then put this formula:
var check=CALCULATE(MAX('table'[argument1]),FILTER(ALL('table'),'table'[argument1]<=EARLIER('table'[argument1]) && 'table'[argument2]<>BLANK())) RETURN CALCULATE(MAX([argument2]),'table'[argument1]=check,ALL('table'))
Option 2: measure
For a measure, click on:
Then put this formula:
var check=CALCULATE(MAX('table'[argument1]),FILTER(ALL('table'),'table'[argument1]<=MAX('table'[argument1]) && 'table'[argument2]<>BLANK())) var result=CALCULATE(MAX([argument2]),'table'[argument1]=check,ALL('table')) RETURN IF(ISBLANK(result),"",result)
NOTE: in my example, the row 1 is blank until row 3 so to exclude them, after “RETURN”, put only “result”
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...








