Forum Discussion
wbarnes
3 years agoFrequent Visitor
Converting Excel IF/OR/AND statement to DAX
I have been trying to convert the below Excel nested IF statement to DAX, and I cannot seem to get anything to work for me, maybe I'm making this more complicated than it really is. I'm new to DAX an...
- 3 years ago
Hi wbarnes ,
Create the following calculated column using DAX.
Completed by DueDate =IF( 'Table'[Due Date] = 0 || ISBLANK('Table'[Due Date]),"Due Date Not Assigned",IF( 'Table'[Completed Date]>= 'Table'[Assigned Date] && 'Table'[Completed Date]<= 'Table'[Due Date],"Yes","No"))There are more efficient ways to do this with switch true statements. However, this should get the job done.Appreciate a thumbs up if you found this helpful.
Please accept this solution if the query is resolved.
jewel_at
3 years agoResolver I
I think in DAX it will be something like this
Column =
IF('Table'[B] =0 || 'Table'[B] = null, "Due Date Not Assigned", IF('Table'[D] >='Table'[A] && 'Table'[D] <= 'Table'[B]',"Yes","No"))
You can also just add a custom column that in Power Query
if([B] = 0 or [B] = null) then "Due Date Not Assigned" else if([D] >= [A] and [D] <= [B]) then "Yes" else "No"
Hope that helps! Let me know!
Jewel
- wbarnes3 years agoFrequent Visitor
Thank you for your suggestion, this works!