Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have found few similar topics, but neither helped with my issue.
I need to write measure, which fills empty values with previous max values.
And I almost did it. In the table below, you can see, that I managed to fill 2022-09-24 and 2022-09-24 with previous max value (on 2022-09-23), becouse 2022-09-23 have only one value (only one row per day). If there are few rows (like in 2023-09-15), my measure does not work.
Any sollutions?
_max_value_no_blanks =
VAR latest_non_blank_date =
CALCULATE( MAX('Calendar'[Date]),
FILTER(ALL('table),
'table'[date] <= MAX('Calendar'[Date]) &&
'table'[value] <> 0
))
VAR latest_non_blank_value =
calculate( MAX('table'[value]),
FILTER(ALL('Calendar'[Date]), 'Calendar'[Date] = latest_non_blank_date))
RETURN
latest_non_blank_rida
Solved! Go to Solution.
Hi @KristinaSp ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
fill blank =
var _a =CALCULATE(MAX('Table'[date]),FILTER(ALL('Table'),'Table'[date]<=MAX('Table'[date]) && 'Table'[value]<>BLANK()))
var _b= CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_a))
return
IF(MAX('Table'[value])=BLANK() && _a<>BLANK(),_b,MAX('Table'[value]))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @KristinaSp ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
fill blank =
var _a =CALCULATE(MAX('Table'[date]),FILTER(ALL('Table'),'Table'[date]<=MAX('Table'[date]) && 'Table'[value]<>BLANK()))
var _b= CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_a))
return
IF(MAX('Table'[value])=BLANK() && _a<>BLANK(),_b,MAX('Table'[value]))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.