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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Radhakrushna
Regular Visitor

Change Values from Negative to Zero in Calculated column

Hello Team,

 

I need you help on priority.

Need to show the Negative values into Zero in calculated column while doing subtract values from one column to another column.

Please find the below screen shot for your reference . 

BBB = Budget - Actual   (in BBB column we can see on row values is in Negative and that should be Zero instead of Negaive value )

 

Radhakrushna_0-1642836506170.png

 

Is it possible...? If possible, please help me on this ASAP on priority.

Thanks for your reply in advance. 

 

Regards,

RK

1 ACCEPTED SOLUTION
bcdobbs
Super User
Super User

If it's a calculate column try:

 

BBB =
VAR Result = TableName[Budget] - TableName[Actual]

RETURN

IF ( Result < 0, 0, Result )



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

If this is a measure and you want the rows to add up to the total, you'll have to iterate over the account type.

 

For example,

SUMX ( VALUES ( Table1[Account Type] ), MAX ( 0, [Budget] - [Actual] ) )

assuming [Budget] and [Actual] are defined measures.

CNENFRNL
Community Champion
Community Champion

Enclose your original measure [BBB] with max(0, bla ... bla)


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

bcdobbs
Super User
Super User

If it's a calculate column try:

 

BBB =
VAR Result = TableName[Budget] - TableName[Actual]

RETURN

IF ( Result < 0, 0, Result )



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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