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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
syntax1995
Frequent Visitor

Sum all values with greater than it's value

Hi Team,,

 

I am new with Dax. 

 

I would like to ask if is it possible to create a measure that will calculate the sum of all values except those values that are less than its value.

 

Here is the example.

IDTotal SpendDesired Result
A250250
B200450
C100550

 

- A(250) is greater than B and C so the result should be 250 only.

- B(200) is greater than C(100) but less that A(250) so you only add A(250) + B(200) = 450

- C(100) is less than A(250) and B(200) so the calculation would be A+B+C = 550

 

Also, the measure should recalculate when being filtered.

 

Thank you so much for your help in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @syntax1995 ,

 

Modify the measure value to:

Desired Result =
CALCULATE (
    SUM ( 'Table'[Total Spend] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Total Spend] >= MAX ( 'Table'[Total Spend] )
    )
)

vtangjiemsft_0-1678340066670.png

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. 

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

This measure works

Measure = SUMX(FILTER(ALL(Data[ID]),[TS]>=MIN(Data[Total Spend])),[TS])

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @syntax1995 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

Desired Result =
CALCULATE (
    SUM ( 'Table'[Total Spend] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Total Spend] >= MAX ( 'Table'[Total Spend] ) )
)

(3) Then the result is as follows.

vtangjiemsft_0-1678328838355.png

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 @Anonymous ,

 

This great. This works well, however, I need the result to be recalculated when being filtered, lets say I try to filter out A(250) then the sumation should not include the value of A(250) since it is being filtered.

 

Thank you so much in advance.

Anonymous
Not applicable

Hi @syntax1995 ,

 

Modify the measure value to:

Desired Result =
CALCULATE (
    SUM ( 'Table'[Total Spend] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Total Spend] >= MAX ( 'Table'[Total Spend] )
    )
)

vtangjiemsft_0-1678340066670.png

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 @Anonymous ,

 

This works ! Great ! Thank you so much !

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.