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
v_mark
Helper V
Helper V

Simple IF Dax Expression

Been trying to figure out how I can calculate this type of condition in dax. Looking into a calculated column. 

 

"If in resolved status and resolved datetime not = to 1/1/1900 is datetime < call datetime"

 

To provide more context 

All of them are column inside of a one table

Status is mainly a status per ticket = Open, Closed, Resolved 

Resolved DateTime = Are timestamps  / Date/time 

Call Datetime = Timestamps / Date/time 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @v_mark 

 

Sorry I'm confused about the description "is datetime < call datetime", what does this mean? And what should be the result when the if condition is true and when it's false?

 

You can use "&&" and "||" to combine multiple conditions in an IF function. And when you use signs like =, <>, <, >... the values on both sides of the sign should be in the same data type so that they can be compared with each other.

Column = IF('Table'[Status]="Resolved" && 'Table'[Resolved DateTime].[Date]<>DATE(1900,1,1) && 'Table'[Resolved DateTime]<'Table'[Call DateTime],"True_Result","False_Result") 

 

Hope this helps.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @v_mark 

 

Sorry I'm confused about the description "is datetime < call datetime", what does this mean? And what should be the result when the if condition is true and when it's false?

 

You can use "&&" and "||" to combine multiple conditions in an IF function. And when you use signs like =, <>, <, >... the values on both sides of the sign should be in the same data type so that they can be compared with each other.

Column = IF('Table'[Status]="Resolved" && 'Table'[Resolved DateTime].[Date]<>DATE(1900,1,1) && 'Table'[Resolved DateTime]<'Table'[Call DateTime],"True_Result","False_Result") 

 

Hope this helps.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

amitchandak
Super User
Super User

@v_mark , You can create a new column like

if([status] ="Resolved" && [Resolved DateTime] <> Date(1900,01,01) && [Resolved DateTime] < [Call Datetime],1,0)

 

you might have to change some condition

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.