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 September 15. Request your voucher.

Reply
ashrat001
Helper I
Helper I

Need to add two measures based on a condition

Hi All,


I need your input as, I want to add two measures based on a simple condition.

Addition =IF(Measure1 >= -1* (Measure2) ,(Measure1 + Measure2),0)


Secondly, should I use measures with Query Name or simple measures names in the formula. Thanks!

 

Tariq Ashraf

4 REPLIES 4
Anonymous
Not applicable

Show the definitions of the measures. Most likely, the measures are written very inefficiently and require a lot of memony because of materialization.

Anonymous
Not applicable

Your measure is really [Addition] = max( [Measure1] + [Measure2], 0 ). Measures should never be preceded by the name of the table they reside in. Columns should always be preceded by their host tables' names. This is the rule in DAX.

amitchandak
Super User
Super User

@ashrat001 , what is the problem you are facing

Addition =IF([Measure1] >= -1* ([Measure2]) ,([Measure1] +[ Measure2]),0)

or

sumx(values(Table[Some ID]),IF([Measure1] >= -1* ([Measure2]) ,([Measure1] +[ Measure2]),0))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

This formula is not working.

Balance = If([Meaure1] >= [Measure2], [Measure1] + [Measure2],0)

I'm getting following error:

Couldn't load the data for this visual. There's not enough memory to complete this operation. Thanks!

 

Tariq 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.