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

If Condition

Hi Team,

 

                 I want an if Condition for this Query :

 

If the Derative Count is greater than gaurav Patel Target (Example :  Derative Count is 100 , gaurav Patel Target is 70 ) ,Here I need 100-70=30 and 30 is multipled by 50 and then

 

If the Derative Count is less than gaurav Patel Target value is to be "0"

 

 

Untitled.png

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @SIBI1998

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
Community Support

Hi, @SIBI1998 ;

You could try it.

value=
IF ( [Derative Count] >= [Patel Target], [Derative Count] - [Patel Target], 0 )

If this doesn't fit your data model, can you share more information about your requirements? For example, are your [Derative Count] and [Patel Target] columns or measures? It is best to share a simple file.

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ValtteriN
Super User
Super User

Hi,

Try something like this:
//if Derative Count and  gaurav Patel Target are measures use them in place of variables

var DC = MAX(Table[Derative Count])
var GPT = MAX(Table[gaurav Patel Target]) return
IF(DC>GPT,(DC-GPT)*50,0)

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





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

Proud to be a Super User!




@ValtteriN 

Given Solution is not working with in this case

There was a ) missing:

//if Derative Count and  gaurav Patel Target are measures use them in place of variables

var DC = MAX(Table[Derative Count])
var GPT = MAX(Table[gaurav Patel Target]) return
IF(DC>GPT,(DC-GPT)*50,0)


What kind of error are you getting?





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

Proud to be a Super User!




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.