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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

PBI doesn't return the correct sum of values

Hello I have two identical mesures (that I put as variables) that are calculated as follows : 

 

CALCULATE (
        SUM ( 'Table1'[Value1] ) + SUM ( 'Table1'[Value2] ),
        FILTER (
            ALL ( 'Date' ),
            YEAR ( MAX ( 'Table3'[Date_1] ) )
                = SELECTEDVALUE ( 'Date'[Year] )

 

CALCULATE (
        SUM ( 'Table2'[Value1] ) + SUM ( 'Table2'[Value2] ),
        FILTER (
            ALL ( 'Date' ),
            YEAR ( MAX ( 'Table3'[Date_2] ) )
                = SELECTEDVALUE ( 'Date'[Year] )

 

I need a mesure that returns the value of the table that has the most recent date : 

 

    IF (
        MAX ( table3[Date_1] )
            > MAX ( 'Table3'[Date_2] ),
        Mesure1,
        Mesure2
    )

 

The formula works correctly in a table graph lign by lign. However, in the total it doesn't sum the values but recalculates the appropriate value taking into consideration the max date values in the totals. So I need a similar mesure that ignores the total context and sums the values instead

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous,

Please take a look at the Greg’s blog about handle measure total level calculation issue if it helps with your scenario:

Measure Totals, The Final Word 
Regards,

Xiaoxin Sheng

djurecic
Super User
Super User

Hi @Anonymous , 

 Have you tried using ALL in your measure to ignore applied filters?

 

https://learn.microsoft.com/en-us/dax/all-function-dax

 

Anonymous
Not applicable

It's about the filters but about the two dates we compare in order to determine which value we take.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.