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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.