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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
cizaguirredigi
Frequent Visitor

comparing negative values in DAX

I'm trying to calculate KPI's in PowerBi. For example we have tickets associated with a Time to resolved being 29m (Actual data) and some other tickets that have a value of -2h 30m. I'm trying to find a formula which can help me determine that if it's a positive value then it meets the kpi, otherwise if it's a negative value then it does not meet. 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Try:

1) As a calculated column:

meets kpi = IF(CONTAINSSTRING(Table[TTR H:M], "-"), "Not meet", "Meet")

 

2) As a measure:

meets kpi = IF(CONTAINSSTRING(MAX(Table[TTR H:M]), "-"), "Not meet", "Meet")





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

Try:

1) As a calculated column:

meets kpi = IF(CONTAINSSTRING(Table[TTR H:M], "-"), "Not meet", "Meet")

 

2) As a measure:

meets kpi = IF(CONTAINSSTRING(MAX(Table[TTR H:M]), "-"), "Not meet", "Meet")





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown it worked perfectly as a Measure!!! Thank you very much for the support!!!!

ryan_mayu
Super User
Super User

@cizaguirredigi 

not sure if 'IF' function can meet your request.

IF(value>=0, "meet","not meet")

 

it's better to provide some sample data and expected output





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

Proud to be a Super User!




I have a calumn with ticket response time (TTR) If the value is negative then the KPI is not met. 

cizaguirredigi_0-1663339289469.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.