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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Sum last non blank value

Hi,

 

I need to sum the latest total asset of two companies. Please advise how to write the measure. Below is my table. Result should be 7,916,759 + 40,000,000 = 47,916,579

 

Capture.PNG

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Calculated column:

Last non blank date =
CALCULATE (
    MAX ( [Date] ),
    FILTER (
        'Table',
        [Source] = EARLIER ( 'Table'[Source] )
            && NOT ( ISBLANK ( [Total Asset] ) )
    )
)
Sum =
CALCULATE (
    SUM ( 'Table'[Total Asset] ),
    FILTER ( 'Table', [Date] = [Last non blank date] )
)

vzhangti_3-1639383378673.png

 

Measure:

Last non blank date M = 
CALCULATE (
    MAX ( [Date] ),
    FILTER (
        ALL('Table'),
        [Source] = MAX( 'Table'[Source] )
            && NOT ( ISBLANK ( [Total Asset] ) )
    )
)
Sum M =
CALCULATE (
    SUM ( 'Table'[Total Asset] ),
    FILTER ( ALL ( 'Table' ), [Date] = [Last non blank date M] )
)

vzhangti_2-1639383265856.png

 

Use the field "Last non blank date" to avoid the problem of taking the maximum value of "Total Asset" instead of the last non blank value.

 

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Calculated column:

Last non blank date =
CALCULATE (
    MAX ( [Date] ),
    FILTER (
        'Table',
        [Source] = EARLIER ( 'Table'[Source] )
            && NOT ( ISBLANK ( [Total Asset] ) )
    )
)
Sum =
CALCULATE (
    SUM ( 'Table'[Total Asset] ),
    FILTER ( 'Table', [Date] = [Last non blank date] )
)

vzhangti_3-1639383378673.png

 

Measure:

Last non blank date M = 
CALCULATE (
    MAX ( [Date] ),
    FILTER (
        ALL('Table'),
        [Source] = MAX( 'Table'[Source] )
            && NOT ( ISBLANK ( [Total Asset] ) )
    )
)
Sum M =
CALCULATE (
    SUM ( 'Table'[Total Asset] ),
    FILTER ( ALL ( 'Table' ), [Date] = [Last non blank date M] )
)

vzhangti_2-1639383265856.png

 

Use the field "Last non blank date" to avoid the problem of taking the maximum value of "Total Asset" instead of the last non blank value.

 

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.

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can create two measure like below for getting required output:-

Distinct_comapny_asset = 
MAXX (
    DISTINCT ( 'Table'[Source] ),
    LASTNONBLANKVALUE ( 'Table'[Source], MAX ( 'Table'[Total Asset] ) )
)

 

Sum_of_assets = 
SUMX ( DISTINCT ( 'Table'[Source] ), [Distinct_comapny_asset] )

output:-

image.png

 

Note:- I have 7,916,559 instead of 7,916,759 due to which output is not matching but it will match at your end.

Below is my table snapshot:-

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Fowmy
Super User
Super User

@Anonymous 

You can use this measure to total by source, it will add the last nonblank value based on the latest date for each source

Total = 
SUMX(
    VALUES(Table1[Source]),
    LASTNONBLANKVALUE( Table1[Date], SUM(Table1[Total Asset] ))
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors