Forum Discussion
wlknsn
Helper I
8 years agoFill empty rows/values with previous/last measure or calculated value
Hi, I'm trying to find a DAX solution for a measure or calculated column which basically returns the last measure/calculated value if the cell is empty. This result should not be an aggregation, ...
Seward12533
Solution Sage
8 years agoWhile its possible in DAX - seethis solution https://community.powerbi.com/t5/Desktop/Fill-down-collumn-information-based-on-condition/td-p/439460
If all your values are numeric then you can use the Fill Option in the Query Editor that will replace blanks with the values in previous rows within columns.
wlknsn
Helper I
8 years agoAs mentionned before, I need to fill this based on a measure. The power query solution is based on data, and not a measure/calculation. Same for the dax solution, that will not work with measure. It's the last measure that needs to be filled.
- Yggdrasill7 years ago
Responsive Resident
I've used this as a calculated column
Fill empty rows = VAR LastNonBlankDate = CALCULATE ( LASTNONBLANK ( dimDates[Date]; 1 ); FILTER ( ALL ( dimDates ); dimDates[Date]<= EARLIER ( dimDates[Date] ) && NOT ( ISBLANK ( dimDates[YourColumnWithBlankRows]) ) ) ) RETURN CALCULATE ( SUM ( dimDates[YourColumnWithBlankRows] ); FILTER ( ALL ( dimDates ); dimDates[Date] = LastNonBlankDate ) )