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
MrNationalParks
Regular Visitor

Same point in time If formula

Hello,

 

I work with Warranty data and would like to see claim totals by Model Year at the same point in time. For MY 15 I need to see July 1st, 2015, MY 16 July 1st, 2016, and MY17 July 1st, 2017. I did this in excel by creating a column that gave me a Yes or No based on this If formula:

IF([MY]="2017",IF([Repair Date]<=TODAY(),"Yes","No"),

IF([MY]="2016",IF([Repair Date]<=(TODAY()-365),"Yes","No"),

IF([MY]="2015",IF([Repair Date]<=(TODAY()-730),"Yes","No"),"ErrorF")))

 

I have tried to search how to write If statements in the Custom Column but they do not seem to work. I've tried using If(XXX) and "if then else".

 

Any help on the formula, or other thoughts on how to do it, would be greatly appreciated

1 ACCEPTED SOLUTION
v-caliao-msft
Microsoft Employee
Microsoft Employee

@MrNationalParks,

 

The syntax for IF function in DAX is
IF(logical_test>,<value_if_true>, value_if_false) 

You do no need  "Then" and "Else" keyword in DAX.

https://msdn.microsoft.com/en-us/library/ee634824.aspx?f=255&MSPPError=-2147217396

 

If this is not what you want, please provide us some sample data and elaborate your expected result, so that we can make further analysis.

 

Regards,

Charlie Liao

View solution in original post

1 REPLY 1
v-caliao-msft
Microsoft Employee
Microsoft Employee

@MrNationalParks,

 

The syntax for IF function in DAX is
IF(logical_test>,<value_if_true>, value_if_false) 

You do no need  "Then" and "Else" keyword in DAX.

https://msdn.microsoft.com/en-us/library/ee634824.aspx?f=255&MSPPError=-2147217396

 

If this is not what you want, please provide us some sample data and elaborate your expected result, so that we can make further analysis.

 

Regards,

Charlie Liao

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.