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
PowerBIFreak
Helper II
Helper II

Calculate the total based on conditions

Hi Folks,

Here is my question, I want to total the amount in the Amount column only value that is equal to or above 200 both negative or positive. This is for the gained and lost inventory. If it's in Excel, I would use the IF, AND function. And I also tried to create a column that said if above =+-200, yes; otherwise no then, I applied the filter and I got the total. But I know somehow we can use the calculate or count in this case? Can you help me please? Thank you.

 

Variance Table

Posting DateAmount
12/28/2020-$100

1/2/2021

-$250
1/3/2021$300
1/4/2021$100
1/5/2021-$50
1/6/2021$400
1/7/2021-$300
2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@PowerBIFreak This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Also, MM3TR&R might be useful: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

AlexisOlson
Super User
Super User

The simplest approach I can think of is this:

CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER ( Table1, ABS ( Table1[Amount] ) >= 200 )
)

but you could use OR too

CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER ( Table1, Table1[Amount] >= 200 || Table1[Amount] <= -200 )
)

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

The simplest approach I can think of is this:

CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER ( Table1, ABS ( Table1[Amount] ) >= 200 )
)

but you could use OR too

CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER ( Table1, Table1[Amount] >= 200 || Table1[Amount] <= -200 )
)

Thank you so much @AlexisOlson !! That works perfectly! I didn't know DAX also use ABS. LOL...I appreciate your help.

Greg_Deckler
Community Champion
Community Champion

@PowerBIFreak This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Also, MM3TR&R might be useful: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.