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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Ignoring Negative Values in Calculated Column

Hi There,

 

I am trying to create a calculated meaure where i am going subtraction from two columns which contains values as below :

Snip_power.JPG

I need the result value which is showing in green(2) however when i am doing subtraction from (Ask-Actual) i am getting a result (-1) however i want to ignore negative values in my measure so that my result value will appear as (2).

 

I have created 3 measures which are as below :

Total_Ask=Sum(ask)

Total Actual-Sum(Actual)
Gap=Total Ask-Total Actual

 

Can anyone please help me in figuring out how can i calculate Gap while ignoring Negative values?

 

Regards,

Ashish 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , of those, are column

 

sumx(table, if([Total Ask]-[Total Actual]>0 ,[Total Ask]-[Total Actual], blank()) )

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

View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

 

Please check the formula.

measure1 = SUM('Table'[ask])-SUM('Table'[actual])

Measure2 = IF([measure1]<0,0,[measure1])

Measure3 = IF(ISINSCOPE('Table'[ask]),[measure1],SUMX(ALL('Table'),[Measure2]))

1.PNG

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Please check the formula.

measure1 = SUM('Table'[ask])-SUM('Table'[actual])

Measure2 = IF([measure1]<0,0,[measure1])

Measure3 = IF(ISINSCOPE('Table'[ask]),[measure1],SUMX(ALL('Table'),[Measure2]))

1.PNG

 

Best Regards,

Jay

amitchandak
Super User
Super User

@Anonymous , of those, are column

 

sumx(table, if([Total Ask]-[Total Actual]>0 ,[Total Ask]-[Total Actual], blank()) )

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.