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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nicolasvc
Helper III
Helper III

Fill blank values with last not blank value

I have a table with the value of a product for the first month of the year per store, but I would like to fill the blank values ​​with the last value that is not blank, it is possible to do it using the EARLIER function, or it has to be with another method?

 

StoreYearMonthProductValue
120201A1
120202A 
120203A 
............ 
120201B2
120202B 
...............
220201A3
...............

 

StoreYearMonthProductValue
120201A1
120202A1
120203A1
...............
120201B2
120202B2
...............
220201A3
220202A3

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @nicolasvc 

 

You can try creating new calculated columns and measures to fill in blank values.

  1. Calculated column

 

New value = 
CALCULATE (
    MAX ( 'Table'[Value] ),
    FILTER (
        'Table',
        [Store] = EARLIER ( 'Table'[Store] )
            && [Product] = EARLIER ( 'Table'[Product] )
    )
)

 

vzhangti_0-1637198844103.jpeg

 

   2. Measure

 

Measure = 
CALCULATE (
    MAX ( 'Table'[Value] ),
    FILTER (
        ALL('Table'),
        [Store] = MAX ( 'Table'[Store] )
            && [Product] = MAX ( 'Table'[Product] )
    )
)

 

vzhangti_1-1637198884763.jpeg

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @nicolasvc 

 

You can try creating new calculated columns and measures to fill in blank values.

  1. Calculated column

 

New value = 
CALCULATE (
    MAX ( 'Table'[Value] ),
    FILTER (
        'Table',
        [Store] = EARLIER ( 'Table'[Store] )
            && [Product] = EARLIER ( 'Table'[Product] )
    )
)

 

vzhangti_0-1637198844103.jpeg

 

   2. Measure

 

Measure = 
CALCULATE (
    MAX ( 'Table'[Value] ),
    FILTER (
        ALL('Table'),
        [Store] = MAX ( 'Table'[Store] )
            && [Product] = MAX ( 'Table'[Product] )
    )
)

 

vzhangti_1-1637198884763.jpeg

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi  @v-zhangti 

 @nicolasvc , the same solution, is there anyway that we can do it in Query Editor ? (in my case non blank value is dynamically generated in a random row based on other column, hence can't use fill up and down) would like to make it through Query editor, not getting a way out. 

Thanks

Srinivas

ERD
Community Champion
Community Champion

@nicolasvc 

Do you need a calculated column or a measure?

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

A calculated column 😞

ERD
Community Champion
Community Champion

@nicolasvc ,

There are different options, you can try this one:

Column =
VAR _s = 'Table'[Store]
VAR _p = 'Table'[Product]
VAR _y = 'Table'[Year]
VAR _m =
    MAXX (
        FILTER ( 'Table', 'Table'[Store] = _s && 'Table'[Product] = _p && 'Table'[Value] <> BLANK () ),
        'Table'[Month]
    )
RETURN
    MAXX (
        FILTER ( 'Table', 'Table'[Store] = _s && 'Table'[Product] = _p && 'Table'[Month] = _m ),
        'Table'[Value]
    )

If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors