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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Fill down colum based on latest value

Delion_0-1617091460970.png

Hi How to fill the colum based on latest value?

example current month March 2021, PROD value 5, April 2021 - Dec 2021 also 5

Thank

 

2 ACCEPTED SOLUTIONS
v-angzheng-msft
Community Support
Community Support

Hi @Anonymous ,

The simplest way is to transform the table by using the fill down feature in the Power Query Editor

v-angzheng-msft_0-1617346359597.jpeg

Sample data:

v-angzheng-msft_1-1617346359598.jpeg

Or you can try to create a calculated column

Fill down (column) =
VAR LastNonBlankDate =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] <= MAX ( 'Table'[Date] )
                && 'Table'[Tech] <> 0
        )
    )
VAR Tech =
    CALCULATE (
        SUM ( 'Table'[Tech] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] = LastNonBlankDate )
    )
RETURN
    IF ( ISBLANK ( 'Table'[Tech] ), Tech, 'Table'[Tech] )

Result:

v-angzheng-msft_2-1617346359601.png

v-angzheng-msft_3-1617346359602.png

 

In addition, you can also to fill down by creating measures

Refer to the above friend's idea, there are 2 method you can try to use.

You can try to use the measure like below:

Method1:

Fill down 1 =
VAR LastNonBlankDate =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] <= MAX ( 'Table'[Date] )
                && 'Table'[Tech] <> 0
        )
    )
RETURN
    CALCULATE (
        SUM ( 'Table'[Tech] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] = LastNonBlankDate )
    )

Method2:

Fill down 2 =
VAR CurrentDate =
    MAX ( 'Table'[Date] )
VAR PreviousValue =
    CALCULATE (
        LASTNONBLANKVALUE ( 'Table'[Date], SUM ( 'Table'[Tech] ) ),
        FILTER ( ALL ( 'Table'[Date] ), 'Table'[Date] < CurrentDate )
    )
RETURN
    IF (
        NOT ISBLANK ( SUM ( 'Table'[Tech] ) ),
        SUM ( 'Table'[Tech] ),
        PreviousValue
    )

Result:

v-angzheng-msft_4-1617346359603.png

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
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

Anonymous
Not applicable

10 REPLIES 10
v-angzheng-msft
Community Support
Community Support

Hi @Anonymous ,

The simplest way is to transform the table by using the fill down feature in the Power Query Editor

v-angzheng-msft_0-1617346359597.jpeg

Sample data:

v-angzheng-msft_1-1617346359598.jpeg

Or you can try to create a calculated column

Fill down (column) =
VAR LastNonBlankDate =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] <= MAX ( 'Table'[Date] )
                && 'Table'[Tech] <> 0
        )
    )
VAR Tech =
    CALCULATE (
        SUM ( 'Table'[Tech] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] = LastNonBlankDate )
    )
RETURN
    IF ( ISBLANK ( 'Table'[Tech] ), Tech, 'Table'[Tech] )

Result:

v-angzheng-msft_2-1617346359601.png

v-angzheng-msft_3-1617346359602.png

 

In addition, you can also to fill down by creating measures

Refer to the above friend's idea, there are 2 method you can try to use.

You can try to use the measure like below:

Method1:

Fill down 1 =
VAR LastNonBlankDate =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] <= MAX ( 'Table'[Date] )
                && 'Table'[Tech] <> 0
        )
    )
RETURN
    CALCULATE (
        SUM ( 'Table'[Tech] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] = LastNonBlankDate )
    )

Method2:

Fill down 2 =
VAR CurrentDate =
    MAX ( 'Table'[Date] )
VAR PreviousValue =
    CALCULATE (
        LASTNONBLANKVALUE ( 'Table'[Date], SUM ( 'Table'[Tech] ) ),
        FILTER ( ALL ( 'Table'[Date] ), 'Table'[Date] < CurrentDate )
    )
RETURN
    IF (
        NOT ISBLANK ( SUM ( 'Table'[Tech] ) ),
        SUM ( 'Table'[Tech] ),
        PreviousValue
    )

Result:

v-angzheng-msft_4-1617346359603.png

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

This work 🙂

Thank @v-angzheng-msft 

HarishKM
Memorable Member
Memorable Member

@Anonymous  Hey,
You can use below dax formula to fulfil your requirement.

You have to crearte a measure then paste below measure to get the same result.

 

Sample test measure =
VAR LastNonBlankDate =
CALCULATE (
MAX ( Sheet1[Date] ),
FILTER (
ALL ( Sheet1 ),
Sheet1[Date] <= MAX ( Sheet1[Date] )
&& Sheet1[Budget] <> 0
)
)
RETURN
CALCULATE (
SUM ( Sheet1[Budget] ),
FILTER ( ALL ( Sheet1 ), Sheet1[Date] = LastNonBlankDate )
)
Output will be .
HarishKM_0-1617161773680.png

 

Anonymous
Not applicable

@HarishKM 

 

I tried to replicate your solution, but why my first column not get volue from budget column ?

 

Delion_0-1617169804578.png

 

@Anonymous  Hey Mate ,
Do not use it for Coloumn . This will work fine with measure .....

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the link below, that is the sample pbix file that I have created.

 

You can try to use the measure like below.

 

Filldown based on the last value =
VAR
currentdate =
MAX ( Data[Date] )
VAR
previousvalue =
CALCULATE (
LASTNONBLANKVALUE ( Data[Date], SUM ( Data[Value] ) ),
FILTER ( ALL ( Data[Date] ), Data[Date] < currentdate )
)
RETURN
IF ( NOT ISBLANK ( SUM ( Data[Value] ) ), SUM ( Data[Value] ), previousvalue )
 
 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim 

 

Thank you so much for your help 🙂

But what I want to achieve is result on power bi table, not visual

 

Do you have any suggestion for this  ?

 

Delion_0-1617152415839.png

 

Delion_1-1617152849092.png

 

 

Hi, @Anonymous 

Thank you for your feedback.

I think, the column/table in a table view cannot operate fill down behavior.

The best choice I can suggest to transform the table to go to Power Query Editor and use the fill-down feature.

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi,

In the Query Editor, use the Fill Down feature.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Angith_Nair
Continued Contributor
Continued Contributor

Hi @Anonymous ,

If the above visual is a table or a matrix, then simply click on the DATE, it will sort the date in ascending or descending order. Descending order will give you the latest value.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.