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
mshamsiev
Helper I
Helper I

Excluding negative values from a calculated column

Hi all,

 

I'm using two columns to determine the mean time to resolve. However, some of the 'resolved' fields are blank resulting in negative calculations for MTR. 

 

Is there any way to exclude the negatives from the calculations in order to determine an accurate average?

 

Much appreciated.

 

Mike 

1 ACCEPTED SOLUTION

Hi @mshamsiev


Instead of doing a calculated column, why not use the same syntax and create a measure. Because that is possibly what you want?

 

Another option which I recommend is to go into the Query Editor and create a conditional column. This is a lot easier as well as has more options to determine your new column.

As well as this will also improve the performance of your Power BI Desktop file.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

5 REPLIES 5
prateekraina
Memorable Member
Memorable Member

Hi @mshamsiev,

 

Can you share the formula which you are using?

 

Prateek Raina

Hi @prateekraina,

 

Thanks for the reply! I think I may have figured it out.

 

Using Time to Resolve = IF((OpenInc[Resolved] - OpenInc[Opened])>=0,(OpenInc[Resolved] - OpenInc[Opened].[Date]),BLANK()). 

 

But now when I attempt to establish a relationship between this table (OpenInc) and the DateKey table, an error arises within the field 'OpenInc' [Time to Resolve]. 

 

-Mike 

Hi @mshamsiev


Instead of doing a calculated column, why not use the same syntax and create a measure. Because that is possibly what you want?

 

Another option which I recommend is to go into the Query Editor and create a conditional column. This is a lot easier as well as has more options to determine your new column.

As well as this will also improve the performance of your Power BI Desktop file.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ,

 

Cheers for the suggestions! As much as I would love to attempt using conditional columns, I've yet to explore query editor. 

 

Does it perform in a similar manner to calculated columns?

 

-Mike 

It is very similar and actually a lot easier to do it in the query editor




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.